Skip to main content

aps-vault (Python)

Standard-library client for the APS Vault machine API. Python 3.9+, no dependencies.

pip install ./clients/python          # or: pip install aps-vault (once published)
import os
from aps_vault import Vault, VaultError

v = Vault("https://vault.example.com", os.environ["VAULT_TOKEN"])   # or Vault.from_env()
try:
    dsn_password = v.get("db-password")
    smtp = v.get_full("smtp")            # {"name","value","login","updated_at",...}
except VaultError as e:
    if e.status == 404: ...
  • get(name) / get_full(name) — cached for cache_ttl seconds (default 300). While the vault is unreachable a stale cached value is returned (fail_open_cache=True) — for at most max_stale seconds after it was fetched (default 86400 = 24 h, None = no limit; 0.41.1) — so a vault restart never takes your service down; the first fetch still fails loudly.
  • put(name, value, login=..., tags=..., url=...) — token needs can_write.
  • totp(name) — current 6-digit code, never cached; token needs can_read_totp.
  • list(), health().
  • Retries 429/5xx/network with 1 s, 2 s, 4 s back-off.

Tokens: pass via environment (VAULT_TOKEN) or a 0600 file (VAULT_TOKEN_FILE). Never commit one, never log one. Vault refuses anything that does not look like a service token.

Sealed delivery (0.17)

If the token is bound to this application's X25519 public key, values arrive encrypted and the client decrypts them in-process (needs the optional extra: pip install 'aps-vault[sealed]'):

python -m aps_vault keygen          # prints VAULT_CLIENT_KEY (private, keep with the token) and client_public_key (for the token)
python -m aps_vault keygen --gost   # GOST R 34.10-2012 pair → the vault seals with VKO + Kuznyechik-MGM; needs pip install 'aps-vault[gost]'
v = Vault(url, token, client_private_key=os.environ["VAULT_CLIENT_KEY"])   # or just set VAULT_CLIENT_KEY
v.get("db-password")

Without the key the client raises VaultError("… sealed values …") rather than returning the envelope; with the wrong key it says so. See docs/SEALED.md.

Metadata

Release files for aps-vault 0.41.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aps-vault 0.41.1
File Size Uploaded
aps_vault-0.41.1.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aps-vault 0.41.1
File Interpreter ABI Platform
aps_vault-0.41.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.3 kB

Release files / aps_vault-0.41.1.tar.gz

Download URL aps_vault-0.41.1.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
de25dd53b8b6c385d3bcd508a0a1fd0572e5b8196ba761b7477e4da4b7bf76c4
BLAKE2b-256 checksum
How to use checksums
7129e2ddb3151396c48b50b243965582f61cee63223b62b413510439d41a7b6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release files / aps_vault-0.41.1-py3-none-any.whl

Download URL aps_vault-0.41.1-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2713b5d97c6d0e7300a509d0e53d042ab847efa2935c0a39bdad9ded96b4e07
BLAKE2b-256 checksum
How to use checksums
0723e8b8db4b357be6ae4b286ef5118d47c107c1f9a3c8ad918bee224e1b50a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 6, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.41.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page