Skip to main content

Native Rust primitives for the Tank SDK — integrity verification, tarball extraction, version resolution, permission checks

Project description

tank-core

Native Rust primitives for the Tank Python SDK. Provides SHA-512 integrity verification, tarball extraction with path traversal protection, semver resolution, and permission checks — built in Rust, exposed via pyo3.

Most users do not install this directly. Install the high-level SDK instead:

pip install "tank-sdk[native]"

That pulls tank-core as a dependency and the SDK loads it transparently. Installing tank-core alone is supported but exposes a low-level API that the SDK abstracts.

Install

pip install tank-core

Pre-built wheels ship for:

  • Linux x86_64 and aarch64 (manylinux_2_28)
  • macOS x86_64 (10.12+) and arm64 (11+)
  • Windows x86_64

Built against Python's stable ABI (abi3), compatible with Python 3.11+. Unsupported platforms (e.g. musllinux, FreeBSD) fall back to an sdist build that requires a Rust toolchain.

Low-level API

import tankpkg_core

tankpkg_core.verify_integrity(data, "sha512-...")
tankpkg_core.extract_tarball(data, "/tmp/dest")
tankpkg_core.resolve_version(["1.0.0", "1.1.0", "2.0.0"], "^1.0.0")
tankpkg_core.is_path_allowed("/src/foo.ts", ["/src/**"])
tankpkg_core.is_domain_allowed("api.anthropic.com", ["*.anthropic.com"])

budget = tankpkg_core.Permissions(
    network_outbound=["*.anthropic.com"],
    fs_read=["/src/**"],
    fs_write=["/output/**"],
    subprocess=False,
)
skill_perms = tankpkg_core.Permissions(fs_read=["/src/**"])
tankpkg_core.check_permission_budget(budget, skill_perms, "@example/skill")

Errors use standard Python exceptions: ValueError for integrity failures, IOError for extraction failures, PermissionError for budget violations.

Building from source

Requires Rust and maturin:

cd packages/sdk-core/crates/python
maturin develop

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_core-0.16.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distributions

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

tank_core-0.16.0-cp39-abi3-win_amd64.whl (314.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

tank_core-0.16.0-cp39-abi3-manylinux_2_28_x86_64.whl (398.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ x86-64

tank_core-0.16.0-cp39-abi3-manylinux_2_28_aarch64.whl (381.7 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

tank_core-0.16.0-cp39-abi3-macosx_11_0_arm64.whl (365.5 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tank_core-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl (386.5 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file tank_core-0.16.0.tar.gz.

File metadata

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

File hashes

Hashes for tank_core-0.16.0.tar.gz
Algorithm Hash digest
SHA256 afc3efab17fc82658c593dd4d8300e548fdd06eb5997e5acb1702430066e9c68
MD5 eb9f7cef26f0e94b010a82435316a79a
BLAKE2b-256 0d33a78af9c13b6a28dd472d90dbde13acdc39a0144ea7e1d59f2abbd73964c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.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_core-0.16.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: tank_core-0.16.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 314.6 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tank_core-0.16.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6d6cdc12f55a73235618a881e5e4ec529a459778577bf2d4a23b94688a068b26
MD5 e238d878833c5f94dc3cc609ee109840
BLAKE2b-256 3ee743ae9793b5ef0b5a3df78fbfa59e757a564afe64d515e9b31fa44382586d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.0-cp39-abi3-win_amd64.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.

File details

Details for the file tank_core-0.16.0-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tank_core-0.16.0-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8571a4aac3653efafa8c63a0cf465084b31cdfbaa36f62e3a34d0504cd850b8b
MD5 00d817bd1d5503337a67812d7f8572f1
BLAKE2b-256 8730cb764b6fe65acffbb8d97f17ce4caa272e4b73b08f30d531b8e65242d4ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.0-cp39-abi3-manylinux_2_28_x86_64.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.

File details

Details for the file tank_core-0.16.0-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tank_core-0.16.0-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 78d3499266aa5fb6ff547926dcbcb5c0182fac4247bd4eeff14ff58f572768e4
MD5 63ef3680750d6f842d7fec3655f3d57a
BLAKE2b-256 ff70d0ffa3b63ce247516b33a42b2482dfdcc51aa3370db9ed0c790a984721c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.0-cp39-abi3-manylinux_2_28_aarch64.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.

File details

Details for the file tank_core-0.16.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tank_core-0.16.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9335c126e84c7a968225cecf1c54e2f7bb768dcbb6e53371d1cffea8c65aa5e
MD5 0d349e228c5c96668bf494cee0a5a55e
BLAKE2b-256 ff5f30a879327549ea782f85a528ff8ac3a31f73133b8e1a0629be5338852be2

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.0-cp39-abi3-macosx_11_0_arm64.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.

File details

Details for the file tank_core-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for tank_core-0.16.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a78d2b941c8b57fdc754eda834c8b8ec07dbd39afd5daf2908f1f780e9e9212a
MD5 d280755d05adf55baa0d2df876d51d3e
BLAKE2b-256 f7762354e6fffb4abc81689e4f76642ef043d771867402e68bcbd10878f66577

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.16.0-cp39-abi3-macosx_10_12_x86_64.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