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.15.5.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.15.5-cp39-abi3-win_amd64.whl (314.6 kB view details)

Uploaded CPython 3.9+Windows x86-64

tank_core-0.15.5-cp39-abi3-manylinux_2_28_x86_64.whl (398.4 kB view details)

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

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

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

tank_core-0.15.5-cp39-abi3-macosx_10_12_x86_64.whl (386.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: tank_core-0.15.5.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.15.5.tar.gz
Algorithm Hash digest
SHA256 71cf987faf7e518be68cf47e05fb0c7e762138f795f032bc0dddd892445f9ee0
MD5 4744b2622b29120cb66118e985b89ee8
BLAKE2b-256 fb287a875e291ff61458376e4c7e00c30aed9b46a864dc261a9bd51e0add1fb1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tank_core-0.15.5-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.15.5-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 303606bb2a8fe8bef7701c8ac919189e28bbd34ec4fb172b57450dbafe1de928
MD5 935f48dd5221de84bd886939f7d1b2fa
BLAKE2b-256 c8b58b9ad7de148b8bf8cc316c5ee98d2071b08cfed92dddb52f66f6c2407a1d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.5-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1eca04730bccb49555c5c14533807756b0164c55f1ab2be13f0b7835a92e9212
MD5 c6af1ecac669b9af6cca12490d2e3c28
BLAKE2b-256 322fc193637aaf279c57b8513a000bc3b542e0d5f2ad951f4fac8dcfc853ccde

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.5-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ffe1ed43a2111917efeafbd320a0fa77d359d11b24c13dcc9e2d5e3fd2eba3ce
MD5 2d13340df7042fc0357d5822e85fa7a2
BLAKE2b-256 429ee1d5bec8306a08fbd3f9170d046e19f6f83b4bd39c9ed441239ce0420efe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.5-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 605eb209872ae498d2146844ab46a7cf79030c6439b966c4e58600dcc520bc0c
MD5 ad109277b38a8e671d36dc1488d305b7
BLAKE2b-256 2927f84094f49a52e0f1376cf08d74f198287432f0c54c91b9321f20b3d23a66

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.5-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a013c051892a121b70374b68e4723236bb1d4954d36812f45097aef5b5dfd6a4
MD5 01b85ff6a6a07fc9ce6293b8ea71bb4d
BLAKE2b-256 572eef4e1f5be3c712c486b38e597a94c2c3b533028c141d9a3da7c70d4205d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for tank_core-0.15.5-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