Skip to main content

Python client for PocketVault secret manager

Project description

pocketvault-client

Python client for PocketVault — a lightweight self-hosted secret manager.

Features

  • Zero external dependencies (stdlib only)
  • In-memory cache with optional auto-refresh
  • Thread-safe
  • Inject secrets directly into os.environ

Installation

pip install pocketvault-client

Usage

from pocketvault import PocketVault

vault = PocketVault(
    url="https://vault.example.com",
    token="your-project-api-token",
    environment="production",
    refresh_interval=60,  # optional: re-fetch every 60 seconds
)

# Get a single secret
db_url = vault.get("DATABASE_URL")

# Get with default value
redis_url = vault.get("REDIS_URL", "redis://localhost:6379")

# Get all secrets as dict
all_secrets = vault.all()

# Inject all secrets into os.environ
vault.to_env()

# Force reload
vault.load()

API

Method Description
get(key, default=None) Get a single secret value
all() Get all secrets as dict
load() Force fetch from PocketVault API
to_env() Inject all secrets into os.environ

Requirements

  • Python 3.7+
  • A running PocketVault instance

License

MIT

Project details


Download files

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

Source Distribution

pocketvault_client-0.1.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

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

pocketvault_client-0.1.1-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file pocketvault_client-0.1.1.tar.gz.

File metadata

  • Download URL: pocketvault_client-0.1.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for pocketvault_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8c515c1c275e39abac19b3207f31fcfd729663fdc0062d310ee8fa6606e33f12
MD5 ba703d85c1ff6249ea99546b8e6228e3
BLAKE2b-256 96161207df452b8c0fd321ee25a9741614b54c0463ca4e052207b9ced48bc8e5

See more details on using hashes here.

File details

Details for the file pocketvault_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pocketvault_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6e7bbc1dea105e20534bca05e30c9e51039f6ffc85e756bb4ced1c99ef14cb1
MD5 91c527cf0a49016a2f39b695cbd48665
BLAKE2b-256 d23aa31d54e9338273f72d0234fff54830a3f0ce86eddaccf5b9c6cbd8073af0

See more details on using hashes here.

Supported by

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