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

Uploaded CPython 3.9+Windows x86-64

tank_core-0.15.6-cp39-abi3-manylinux_2_28_x86_64.whl (398.1 kB view details)

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

tank_core-0.15.6-cp39-abi3-manylinux_2_28_aarch64.whl (381.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

tank_core-0.15.6-cp39-abi3-macosx_11_0_arm64.whl (365.2 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

tank_core-0.15.6-cp39-abi3-macosx_10_12_x86_64.whl (386.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: tank_core-0.15.6.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.6.tar.gz
Algorithm Hash digest
SHA256 b757acabad90467938900527bb9b828ba89275011774380bf07711fdd635d9e3
MD5 d9a8fa6af87c0526818f53af8965fed4
BLAKE2b-256 d747d8169033b522789d764c57426597ad3ca25152c6725e690e6856d82bfb2e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: tank_core-0.15.6-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 314.8 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.6-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7236bd4a5dcc901b5f49f2859a1dccc93b443410a40f2cc6f7fc4c113983b585
MD5 1f92aa0ea0d234a067ea5d69fed7f70c
BLAKE2b-256 9c6eafeafa199f66c0cded3f2d4888017544b615737cb1a2a74d16c906b519ac

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.6-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3ff52eddf1747e3a9adeafb64d5acde7474e2a0aa05195ecff160976080bfce1
MD5 2110f53d286476d7882d83b8875506bd
BLAKE2b-256 f91248fd20a3c9778cc046b939baf4f1a9c121003d30561ea1ec175250a28da0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.6-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 359b2e1268a462c4db219fd3ade5dfcd236a24731438aef9d1bb49906e6fde29
MD5 ce7fd6aac9de24633d721fba9d43ad75
BLAKE2b-256 15fcd0ed26ea6fdce03f75aca9bf24d7399b66524574d92a1f0921e43e367b28

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.6-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3a8864fe32ed005477add4414bd10f1fb2d1cacddd6f55b937c613903b661e6a
MD5 23d98af8a40fd3dfd275797f4df0b2d7
BLAKE2b-256 bd0ab7878e01de7609632e31cd80505bd9c4e9d735488d5404b1f48c62e3260f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for tank_core-0.15.6-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f352f84b554d4fcb828049c0ad3d7163e64efb4988dba0f3361ae6cfcf008d4a
MD5 5018a2bc47a4b9e1f8bd92edd18ffc53
BLAKE2b-256 b928f4180c47b7127357ec187a51875c505a612537a54bcf70422819411e6ea8

See more details on using hashes here.

Provenance

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