Skip to main content

Official Python SDK for the Tank registry — search, download, and read AI agent skills programmatically, with security built in

Project description

tank-sdk

Official Python SDK for Tank — the security-first package manager for AI agent skills.

Search, download, read, and audit skills from the Tank registry. Designed for agent frameworks, notebook workflows, and any Python tool that wants to consume AI skills with provenance and integrity guarantees.

Install

pip install tank-sdk

For faster integrity verification, install the native extra:

pip install "tank-sdk[native]"

This installs tank-core — pre-built Rust wheels for Linux x86_64/aarch64, macOS x86_64/arm64, and Windows x86_64 (Python 3.11+). On unsupported platforms, pip will either build from source (requires a Rust toolchain) or fail. If you don't want the native dep, install the plain tank-sdk — every feature remains available via the pure-Python fallback.

Quick start

from tankpkg import TankClient

with TankClient() as client:
    results = client.search("nextjs")
    for skill in results.get("skills", []):
        print(skill["name"], skill["description"])

    skill = client.read_skill("@tank/nextjs")
    print(skill.content)

Authentication

The SDK reads ~/.tank/config.json (managed by the tank CLI) or the TANK_TOKEN environment variable. Login with:

tank login

Or pass a token explicitly:

TankClient(token="your-token")

Self-hosted registries

TankClient(registry_url="https://tank.your-company.com")

Or set TANK_REGISTRY_URL.

API

  • search(query, *, page, limit) — search the registry
  • info(name) — skill metadata
  • versions(name) — list available versions
  • version_detail(name, version) — full version record including scan_verdict, audit_score, integrity (SHA-512)
  • download(name, version, *, dest) — download and verify tarball
  • read_skill(name, version=None) — SKILL.md + references + scripts inline
  • list_files(name, version=None) — file listing within a version
  • read_file(name, version, path) — read a single file
  • audit(name, version=None) — security scan verdict for latest or pinned version
  • permissions(name, version=None) — resolved permission budget
  • whoami() — authenticated user info
  • star(name) / unstar(name) / get_star_count(name)

All methods raise typed exceptions: TankAuthError, TankNotFoundError, TankPermissionError, TankNetworkError, TankIntegrityError, TankConflictError.

Native acceleration

tank-sdk works fully in pure Python. Installing tank-sdk[native] pulls tank-core — Rust bindings that are wired in where it matters most today: SHA-512 integrity verification on TankClient.download(). The Rust core also exposes tarball extraction, semver resolution, and permission checks as primitives that are used by the Tank CLI and available for direct import as tankpkg_core.

Check whether native acceleration is active:

from tankpkg import has_native
print(has_native())  # True if tank-core is installed and loaded

When native acceleration is unavailable, tank-sdk falls back to hashlib.sha512 for integrity verification — same security guarantees, pure Python.

Requirements

  • Python 3.11+
  • httpx (installed automatically)

Links

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tank_sdk-0.14.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tank_sdk-0.14.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file tank_sdk-0.14.0.tar.gz.

File metadata

  • Download URL: tank_sdk-0.14.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tank_sdk-0.14.0.tar.gz
Algorithm Hash digest
SHA256 7ccd0e06aea282785eb9267847485263ba78cc976a42914536f3bf470a577121
MD5 b90f6dd6e3d3e39e6499de847f478a5e
BLAKE2b-256 4fe77ae936a2e0af724e18ad0f8e94c5a2ab1f242b79424a0bdc742625c12c6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_sdk-0.14.0.tar.gz:

Publisher: release.yml on tankpkg/tank

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tank_sdk-0.14.0-py3-none-any.whl.

File metadata

  • Download URL: tank_sdk-0.14.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tank_sdk-0.14.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9052bc3930f408cad77d8f0a6ee5ba9ef39076a59621e29ab910bd3aed2ecea
MD5 56a513bcb1dcdade4dfd6e6fec23ef68
BLAKE2b-256 71bfea9b7810fd43478cd80db078cdadf565cdb3a70c53c171b9d985d1881d2c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_sdk-0.14.0-py3-none-any.whl:

Publisher: release.yml on tankpkg/tank

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page