vibr8vault-sdk
Python SDK for Vibr8Vault — a self-hosted secrets manager.
Installation
pip install vibr8vault-sdk
Development Setup
# Clone the repo and navigate to the Python SDK
cd sdk/python
# Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install the SDK in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run type checking
mypy src/
Quick Start
from vibr8vault import Vibr8Vault
vault = Vibr8Vault(address="http://localhost:8200", token="your-service-token")
# Read a secret
secret = vault.secrets.read("apps/backend/prod")
print(secret["data"]["DB_PASSWORD"])
# List secrets under a prefix
listing = vault.secrets.list("apps/")
print(listing["keys"])
# Check vault health
health = vault.sys.health()
print(health["status"])
API Reference
Secrets
vault.secrets.read(path, version=None) # Read a secret (optionally a specific version)
vault.secrets.write(path, data) # Write key-value pairs to a path
vault.secrets.delete(path, hard=False) # Soft-delete (or hard-delete) a secret
vault.secrets.list(prefix) # List secret paths under a prefix
vault.secrets.versions(path) # List all versions of a secret
Namespace-scoped variants: read_ns, write_ns, delete_ns, list_ns, versions_ns — each takes ns as the first argument.
Tokens
vault.tokens.create(type=None, ttl=None, policies=None, max_uses=None)
vault.tokens.revoke(id)
vault.tokens.list()
Auth
vault.auth.login(username, password)
vault.auth.me()
Users
vault.users.create(username, password, policies=None)
vault.users.list()
vault.users.get(id)
vault.users.update(id, password=None, policies=None)
vault.users.delete(id)
System
vault.sys.health()
vault.sys.status()
vault.sys.unseal(key)
vault.sys.seal()
Namespaces
vault.namespaces.list()
vault.namespaces.get(name)
vault.namespaces.create(name)
vault.namespaces.delete(name)
Policies
vault.policies.list(ns=None)
vault.policies.get(name, ns=None)
vault.policies.create(yaml, ns=None)
vault.policies.delete(name, ns=None)
Client Management
vault.set_token(token) # Change the auth token after construction
vault.close() # Close the underlying HTTP connection
Use as a context manager for automatic cleanup:
with Vibr8Vault("http://localhost:8200", "your-token") as vault:
secret = vault.secrets.read("apps/backend/prod")
Error Handling
from vibr8vault import Vibr8Vault, Vibr8VaultError
vault = Vibr8Vault("http://localhost:8200", "your-token")
try:
secret = vault.secrets.read("nonexistent/path")
except Vibr8VaultError as e:
print(f"Error: {e} (HTTP {e.status})")
Requirements
- Python 3.9+
- A running Vibr8Vault instance
Release files for vibr8vault-sdk 0.5.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 | |
|---|---|---|---|
| vibr8vault_sdk-0.5.0.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vibr8vault_sdk-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.4 kB
Release files / vibr8vault_sdk-0.5.0.tar.gz
| Download URL | vibr8vault_sdk-0.5.0.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7221ae4ad06869bfb646cc8045554d58a9e085b38de8104fa2fdd87e0c799a01
|
|
BLAKE2b-256 checksum How to use checksums |
1f488c5ae68d23c914f1ad9cf998d87a221eec93ea4d04ea33ceba8bb47e64a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|
Release files / vibr8vault_sdk-0.5.0-py3-none-any.whl
| Download URL | vibr8vault_sdk-0.5.0-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
422cbe47543753d85e9223b2b470218ee27cb41e666821980977eb31838d837e
|
|
BLAKE2b-256 checksum How to use checksums |
29034c03b2f7d9300f2868375c9e56afc3b9286381abf89df37b679007ab6dba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.2
|