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 registryinfo(name)— skill metadataversions(name)— list available versionsversion_detail(name, version)— full version record includingscan_verdict,audit_score,integrity(SHA-512)download(name, version, *, dest)— download and verify tarballread_skill(name, version=None)— SKILL.md + references + scripts inlinelist_files(name, version=None)— file listing within a versionread_file(name, version, path)— read a single fileaudit(name, version=None)— security scan verdict for latest or pinned versionpermissions(name, version=None)— resolved permission budgetwhoami()— authenticated user infostar(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
- Homepage: https://tankpkg.dev
- Documentation: https://www.tankpkg.dev/docs/sdk-python
- Source: https://github.com/tankpkg/tank
- Issues: https://github.com/tankpkg/tank/issues
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tank_sdk-0.14.1.tar.gz.
File metadata
- Download URL: tank_sdk-0.14.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee14c1a40d8e37882fd72db1b4ae2b10b968190336fdd00cf06a2bea5f184e02
|
|
| MD5 |
b6593a484e39051a81e64124633af34e
|
|
| BLAKE2b-256 |
3c66937ac80e90e66376901d97753872f598a9a28ca520cced792c9e92827000
|
Provenance
The following attestation bundles were made for tank_sdk-0.14.1.tar.gz:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_sdk-0.14.1.tar.gz -
Subject digest:
ee14c1a40d8e37882fd72db1b4ae2b10b968190336fdd00cf06a2bea5f184e02 - Sigstore transparency entry: 1340717236
- Sigstore integration time:
-
Permalink:
tankpkg/tank@907642c8b1b12dfa780c1211955a0e9f6a28cd53 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@907642c8b1b12dfa780c1211955a0e9f6a28cd53 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tank_sdk-0.14.1-py3-none-any.whl.
File metadata
- Download URL: tank_sdk-0.14.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2acd0d41ee44883d4387e4ddd6f25205e0aa38736b8952931017d54d7040f85
|
|
| MD5 |
d1670c2672200a2f8dcc13d6e540c89d
|
|
| BLAKE2b-256 |
5f70594ac08041240bc33755b524b774e113138344b5ddc9d73fde751d4b66bb
|
Provenance
The following attestation bundles were made for tank_sdk-0.14.1-py3-none-any.whl:
Publisher:
release.yml on tankpkg/tank
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tank_sdk-0.14.1-py3-none-any.whl -
Subject digest:
b2acd0d41ee44883d4387e4ddd6f25205e0aa38736b8952931017d54d7040f85 - Sigstore transparency entry: 1340717240
- Sigstore integration time:
-
Permalink:
tankpkg/tank@907642c8b1b12dfa780c1211955a0e9f6a28cd53 -
Branch / Tag:
refs/tags/v0.14.1 - Owner: https://github.com/tankpkg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@907642c8b1b12dfa780c1211955a0e9f6a28cd53 -
Trigger Event:
push
-
Statement type: