Python SDK

Load secrets directly into a Python application at startup.

Python SDK

Load secrets directly into your Python application at startup. One-liner setup or fine-grained control with the fluent builder.

Install

uv add envilder
# or
pip install envilder

Quick start: one-liner

Load secrets from a map file and inject them into the environment:

from envilder import Envilder

Envilder.load('envilder.json')

Environment-based loading

Recommended for multi-environment apps. Map each environment to its own secrets file:

from envilder import Envilder
import os

env = os.getenv('APP_ENV', 'development')

Envilder.load(env, {
    'production': 'prod-secrets.json',
    'development': 'dev-secrets.json',
    'test': None,
})

Resolve without injecting

Get secrets as a dictionary without modifying the environment:

secrets = Envilder.resolve_file('envilder.json')

Fluent builder with overrides

Override provider settings programmatically using the fluent API:

from envilder import Envilder, SecretProviderType

secrets = (
    Envilder.from_map_file('envilder.json')
    .with_provider(SecretProviderType.AZURE)
    .with_vault_url('https://my-vault.vault.azure.net')
    .resolve()
)

Secret validation

Opt-in validation ensures all resolved secrets have non-empty values:

from envilder import Envilder, validate_secrets

secrets = Envilder.resolve_file('envilder.json')
validate_secrets(secrets)  # raises SecretValidationError if any value is empty

Full documentation →