Skip to main content

naturalis-vault

OpenBao Vault client library for Naturalis.

  • Vault: reads secrets from Vault KV v2, given a token
  • refresh_vault_token: obtains a token via OIDC authentication

The library never writes tokens or secrets to your filesystem. Token persistence across different sessions is up to the user.

Installation

# UV
uv add naturalis-vault

# pip
pip install naturalis-vault

Usage

from naturalis.vault import Vault, refresh_vault_token

# Obtain a token (opens browser for OIDC login)
token = refresh_vault_token()

# Retrieve a secret
vault = Vault(
    secret_path="team/project/production",
    token=token,
)

api_key = vault.get_secret("IMPORTANT_API_KEY")

To avoid having to log in on every run, store the token yourself. The package automatically retrieves the VAULT_TOKEN environment variable if it was set.

vault = Vault(
    secret_path="team/project/production",
)

Or even monitor the token's last refresh date and regenerate it automatically:

import os
from datetime import date

today = str(date.today())
token = os.getenv("VAULT_TOKEN")

# Consider the vault token to be fresh if it was last refreshed today
if os.getenv("VAULT_TOKEN_LAST_REFRESH") != today and token:
    token = refresh_vault_token()
    os.environ["VAULT_TOKEN"] = token
    os.environ["VAULT_TOKEN_LAST_REFRESH"] = today

Metadata

Release files for naturalis-vault 0.3.2

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

Source distribution (sdist)

Source distribution for naturalis-vault 0.3.2
File Size Uploaded Provenance Actions
naturalis_vault-0.3.2.tar.gz 3.6 kB Without provenance Details for naturalis_vault-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for naturalis-vault 0.3.2
File Interpreter ABI Platform Actions
naturalis_vault-0.3.2-py3-none-any.whl Python 3 none any Details for naturalis_vault-0.3.2-py3-none-any.whl

Total release size: 8.4 kB

Release files / naturalis_vault-0.3.2.tar.gz

Download URL naturalis_vault-0.3.2.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f844a4eddd37850047b334221802caf9ef0d9e8c69ab8d56d866bfd62c71c52e
BLAKE2b-256 checksum
How to use checksums
edc17ac2611ef5a24dadb4d77a89933bc0d2769599d18525a1e6745c9bfbc08b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / naturalis_vault-0.3.2-py3-none-any.whl

Download URL naturalis_vault-0.3.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a4d8a84bd2c8ac9f5d7d8a38ba885f97b82f933ef86248226ab80432d12b56fd
BLAKE2b-256 checksum
How to use checksums
a31cdf64bdb94ae42686e6922440a4ac02bcdcc471d3cc53bc8395c77f1e5ac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.30 {"installer":{"name":"uv","version":"0.9.30","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"12","id":"bookworm","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for naturalis-vault 0.3.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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