Skip to main content

Thorax for Python

Native Python SDK for Thorax, secrets management for humans, agents, and apps.

The SDK is a small application-facing facade over Thorax's shared operation layer. It uses the same vault validation, authorization, keychain, and cryptography as the CLI, TUI, Rust SDK, and Node SDK.

Installation

Thorax requires Python 3.9 or later.

pip install thorax

The SDK opens an existing Thorax vault. Install the Thorax CLI and run thorax init in your project if you do not have one yet.

Quick start

By default, Vault opens .thorax/vault.cord and authenticates with the configured local identity and keychain:

import thorax

vault = thorax.Vault()
database_url = vault.get("app/prod/db")

Pass the directory containing vault.cord when the vault is elsewhere:

vault = thorax.Vault("/srv/my-app/.thorax")

Values are UTF-8 strings by default. Set as_bytes=True when reading a binary value:

certificate = vault.get("app/prod/certificate", as_bytes=True)
vault.set("app/prod/token", b"binary value")

Working with secrets

vault.set("app/prod/db", "postgres://localhost/app")
vault.set_field("app/prod/db", "username", "app")

username = vault.get_field("app/prod/db", "username")
fields = vault.fields("app/prod/db")
selectors = vault.list("app/prod")

vault.delete_field("app/prod/db", "username")
vault.delete("app/prod/db")

Selectors may be strings such as app/prod/db@region=eu, or structured thorax.Selector objects.

Authentication

Local development uses the keychain by default. You can select a particular identity or supply a passphrase to a noninteractive caller:

auth = thorax.Auth.from_keychain("alice", passphrase="...")
vault = thorax.Vault(auth=auth)

For CI and deployed applications, use a dedicated, least-privilege invite identity. Auth.from_env() reads exactly one of THORAX_UNSAFE_INVITE or THORAX_UNSAFE_INVITE_FILE:

vault = thorax.Vault(auth=thorax.Auth.from_env())

An invite is a private capability. Keep it out of source control and prefer the file variable when your runtime can mount it as a secret. Auth.from_invite() also accepts an invite directly.

Errors and session behavior

Operations raise subclasses of thorax.ThoraxError: NotFound, PermissionDenied, ConflictError, ValidationError, and IdentityError.

A session validates the vault when it opens and sees its own writes immediately. Create a new Vault to pick up changes written by another process. Opening fails while the vault has unresolved conflicts.

See the Thorax documentation for vault setup, selectors, access control, and the security model.

Thorax is licensed under the Apache License 2.0.

Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

thorax-1.0.1-cp39-abi3-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.9+Windows x86-64

thorax-1.0.1-cp39-abi3-manylinux_2_28_x86_64.whl (1.4 MB view details)

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

thorax-1.0.1-cp39-abi3-manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.28+ ARM64

thorax-1.0.1-cp39-abi3-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

thorax-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file thorax-1.0.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: thorax-1.0.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thorax-1.0.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8ee2469c972ecc1be7c29cc0b117b41787d46c12c6e4c9b0cf0534e412f2e272
MD5 878773073b2d289f4c3b4fc8d85043ea
BLAKE2b-256 b40b2d1760318a4d423f53131b2c3a47331f59411ea21cab8dac643325d3a139

See more details on using hashes here.

File details

Details for the file thorax-1.0.1-cp39-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: thorax-1.0.1-cp39-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thorax-1.0.1-cp39-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3ab156761628b4bf4d7b6ba5da0dc66dc4e1355e8af9ff78a42e220a9abee21b
MD5 91244a21bd27160f6be9c0071def89e1
BLAKE2b-256 9513f2e41a1c05c420ad8adc75d92f863b55a33a5ed3e2603de62fb593cfbe1f

See more details on using hashes here.

File details

Details for the file thorax-1.0.1-cp39-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: thorax-1.0.1-cp39-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thorax-1.0.1-cp39-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 f8ecd2eb7780e80fcfbb331668125582cfb534016fb2d3de9548bd570cf10fc2
MD5 f98186c5bb4e3066c62a2bdb178f95ff
BLAKE2b-256 9826a903dffe033f01753ddf85cbacf349b8b5595efd40bee8f032e4bd68680f

See more details on using hashes here.

File details

Details for the file thorax-1.0.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: thorax-1.0.1-cp39-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: CPython 3.9+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thorax-1.0.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adea4b29f3324ea3dd4ae1b04157f3e5579e1c047268b426d5f2e1ad2add8704
MD5 621236bde8fc25bb82088ae8d6958fa7
BLAKE2b-256 6a46775b0bfe686f73ba53d7801ffb6c64b71367fa497620640f8868c4d0cbc5

See more details on using hashes here.

File details

Details for the file thorax-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: thorax-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: CPython 3.9+, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for thorax-1.0.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b9028f6cbca982c130743a5a392c7c4f43246fe769eb2f825de1f54335acca84
MD5 8bdbb235ddc2835ebb762cee88ac2884
BLAKE2b-256 b540fa41cd44b343832fc0dbb9d40e669b0c9a95d9a74097c69d10ce1fcf38ee

See more details on using hashes here.

Release history Release notifications | RSS feed

1.1.0

5 files

This release

1.0.1 This release

5 files

1.0.0

5 files

Supported by

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