Skip to main content

winwin-vault

PyPI version License

A read-only Python client for HashiCorp Vault, with automatic token renewal and dynamic secret caching.

Installation

pip install winwin-vault

Quick Start

from winwin_vault import VaultClient

# Uses VAULT_ADDR and auth method from environment
client = VaultClient.from_env()

# Read a KV v2 secret
secret = client.read_kv("config")
print(secret["api_key"])

# Read database credentials (cached with TTL)
creds = client.read_database_creds("my-role")
print(creds.username, creds.password)

# Read Alicloud STS credentials (cached with TTL)
alicreds = client.read_alicloud_creds("my-role")
print(alicreds.access_key, alicreds.secret_key, alicreds.security_token)

Authentication

VaultClient.from_env() auto-detects the auth method:

Environment Auth Method
VAULT_TOKEN set EnvTokenAuth
~/.vault-token present EnvTokenAuth
Kubernetes ServiceAccount KubernetesAuth
Vault Agent socket VaultAgentAuth

TLS is enforced for all auth methods except VaultAgentAuth (which communicates over a local Unix socket).

Mount Points

Default mount points:

  • KV v2: secret
  • Database: database
  • Alicloud: alicloud

Change via setters:

client.set_kv_mount_point("internal")
client.set_database_mount_point("database")
client.set_alicloud_mount_point("alicloud")

Exception Handling

from winwin_vault import VaultClient, VaultClientError, VaultSecretNotFoundError

try:
    secret = client.read_kv("config")
except VaultSecretNotFoundError:
    print("Secret not found")
except VaultClientError as e:
    print(f"Vault error: {e}")

License

MIT License — see LICENSE file to be added.

Download files

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

Source Distribution

winwin_vault-0.1.5.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

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

winwin_vault-0.1.5-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file winwin_vault-0.1.5.tar.gz.

File metadata

  • Download URL: winwin_vault-0.1.5.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for winwin_vault-0.1.5.tar.gz
Algorithm Hash digest
SHA256 675f5b557a7ebfb679c741f9fe74e1e3e6c05869127f4efaf7f48e6812fb112c
MD5 ab15db081c01f4f9e8c87dd09c34388c
BLAKE2b-256 3ab039eff9819c6c24e782fdc1b9d9fffdb094180a2e0eaa6907558c2d7ca737

See more details on using hashes here.

File details

Details for the file winwin_vault-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: winwin_vault-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for winwin_vault-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb4849c603c30377a668e21cb41215bb536e1b43347515afe285446487c86e60
MD5 c7eadb7b9874af99b9cd5610971c054d
BLAKE2b-256 6391ef2a60c3f583588645cedbec8c0e7e22cd4e813316798fc7eb22d7a87d7b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.8

2 files

0.1.6

2 files

This release

0.1.5 This release

2 files

0.1.3

2 files

0.1.1

2 files

0.1.0

2 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