vault-kv-client
vault-kv-client is a small, typed, and production-friendly helper library for
working with HashiCorp Vault KV engines through hvac.
It focuses on the common parts teams end up re-implementing around Vault:
- KV v1 and v2 support with automatic mount version detection
- Token, AppRole, Kubernetes, and Vault JWT/OIDC authentication
- Enterprise namespace support
- Recursive listing and secret copy helpers
- Optional in-memory read caching
- Environment-driven bootstrap for CI, Kubernetes, and legacy Airflow deployments
Installation
pip install vault-kv-client
With uv:
uv add vault-kv-client
With Poetry:
poetry add vault-kv-client
Quick Start
from vault_kv_client import VaultAuth, VaultManager, VaultSettings
settings = VaultSettings(
addr="https://vault.example.com",
verify=True,
namespace=None,
)
auth = VaultAuth(token="s.xxxxx")
client = VaultManager(settings=settings, auth=auth)
secret = client.get_secret("kv", "apps/my-service")
print(secret["username"])
Environment-driven bootstrap is also available:
from vault_kv_client import get_default_manager
client = get_default_manager()
secret = client.get_secret("kv", "apps/my-service")
Public API
Root package exports:
VaultManagerVaultSettingsVaultAuthVaultJWTAuthVaultKubernetesAuthVaultClientErrorVaultNotConfiguredErrorVaultDependencyErrorSecretNotFoundErrorget_default_manager()get_creds()
Core methods:
get_secret(mount_point, path, kv_version=None)upsert_secret(mount_point=..., path=..., secret=..., kv_version=None)list_secrets(mount_point, path="", kv_version=None)list_all_secrets(mount_point, path="", kv_version=None)copy_secret(source_mount=..., target_mount=..., path=...)clear_cache()
Authentication Modes
The library supports four mutually exclusive auth modes:
tokenapprolekubernetesjwt
Full examples are documented in docs/auth-methods.md.
Legacy Compatibility
The historical package name vault_client is still shipped as a temporary
compatibility layer:
from vault_client import VaultManager
That import path now emits a DeprecationWarning. New projects should use
vault_kv_client.
Documentation
Repository docs are designed for self-service onboarding:
- Getting Started
- Installation
- Auth Methods
- KV v1/v2 Behavior
- API Reference
- Migration from
vault_client - Development
- Security
- Release Process
The GitHub Pages site is generated from the same sources via MkDocs Material.
Development
python3 -m venv .venv
. .venv/bin/activate
pip install -U pip uv
uv pip install -e ".[dev]"
ruff check .
mypy src
pytest -q
mkdocs build
Security
- Never log secret payloads.
- Prefer short-lived auth flows where possible.
- Use the minimum Vault policy scope required for your application.
- Report security issues through the process described in SECURITY.md.
License
This project is licensed under the Apache License 2.0. See LICENSE.
Metadata
Release files for vault-kv-client 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| vault_kv_client-0.1.0.tar.gz | 13.3 kB | Without provenance | Details for vault_kv_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| vault_kv_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for vault_kv_client-0.1.0-py3-none-any.whl |
Total release size: 32.9 kB
Release files / vault_kv_client-0.1.0.tar.gz
| Download URL | vault_kv_client-0.1.0.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e7e5598eb73641da7f6ca778ae31acb355aea796ec33c0bb50711b48e34c751a
|
|
BLAKE2b-256 checksum How to use checksums |
52c661d5fa893066f7d1408d495d376b1fa8cca618545512eff68ce553391a68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / vault_kv_client-0.1.0-py3-none-any.whl
| Download URL | vault_kv_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cbbee03db68f33d93a900b9809e30854699a2bab712c6052e1864d8c038b76ce
|
|
BLAKE2b-256 checksum How to use checksums |
50fa6221b9dd0ae41da1bd878f4a20bf41490e167e3cf24d45d8f3daf5a83da6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for vault-kv-client 0.1.0
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.