Securely load environment variables from AWS SSM Parameter Store or Azure Key Vault.
Project description
Envilder Python SDK
Securely load environment variables from AWS SSM Parameter Store or Azure Key Vault directly into your Python application. Zero vendor lock-in — secrets stay in your cloud.
Part of the Envilder project.
Prerequisites
- Python 3.10+
- AWS provider: AWS credentials configured (CLI, environment variables, or IAM role)
- Azure provider: Azure credentials via
az login, managed identity, or environment variables
Install
pip install envilder
Quick Start
One-liner
from envilder import Envilder
# Resolve secrets and inject into os.environ
Envilder.load('secrets-map.json')
import os
print(os.environ['DB_PASSWORD'])
Resolve without injecting
from envilder import Envilder
secrets = Envilder.resolve_file('secrets-map.json')
print(secrets['DB_PASSWORD'])
Fluent builder (with overrides)
Override the map file's $config at runtime — useful for switching providers,
profiles, or vault URLs per environment:
from envilder import Envilder, SecretProviderType
# Override provider + vault URL
secrets = (
Envilder.from_file('secrets-map.json')
.with_provider(SecretProviderType.AZURE)
.with_vault_url('https://my-vault.vault.azure.net')
.resolve()
)
# Override AWS profile and inject
(
Envilder.from_file('secrets-map.json')
.with_profile('staging')
.inject()
)
Advanced usage
For full control over parsing, provider creation, and secret resolution:
from envilder import (
EnvilderClient,
EnvilderOptions,
MapFileParser,
SecretProviderFactory,
SecretProviderType,
)
with open('secrets-map.json', encoding='utf-8') as file:
json_content = file.read()
map_file = MapFileParser().parse(json_content)
# Optional: override config at runtime
options = EnvilderOptions(
provider=SecretProviderType.AZURE,
vault_url='https://my-vault.vault.azure.net',
)
provider = SecretProviderFactory.create(map_file.config, options)
client = EnvilderClient(provider)
secrets = client.resolve_secrets(map_file)
EnvilderClient.inject_into_environment(secrets)
Map File Format
{
"$config": {
"provider": "aws",
"profile": "my-profile"
},
"DB_PASSWORD": "/app/prod/db-password",
"API_KEY": "/app/prod/api-key"
}
Supported providers: aws (default), azure.
For Azure, add vaultUrl:
{
"$config": {
"provider": "azure",
"vaultUrl": "https://my-vault.vault.azure.net"
},
"DB_PASSWORD": "db-password",
"API_KEY": "api-key"
}
License
MIT
Development
Setup
# From the repo root
make install-sdk-python
Quality checks
make check-sdk-python # black + isort + mypy (no changes)
make format-sdk-python # auto-format
Running tests
Unit tests run without any external dependencies:
cd tests/sdks/python
python -m pytest -v -m "not acceptance"
Acceptance tests require Docker and a LocalStack auth token:
export LOCALSTACK_AUTH_TOKEN=<your-token>
cd tests/sdks/python
python -m pytest -v -m acceptance
All tests:
make test-sdk-python
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file envilder-0.2.0.tar.gz.
File metadata
- Download URL: envilder-0.2.0.tar.gz
- Upload date:
- Size: 72.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efe67257109c34d127b1a1d3a50974639ecce6cfd899e4b26337de12563644e8
|
|
| MD5 |
4fa5125c010a5b24f163e8d528140d5c
|
|
| BLAKE2b-256 |
3d800b6c28f999e0f742e5cae0ed806bb4b55f792b1dc2fe6c4ba669c87476c0
|
Provenance
The following attestation bundles were made for envilder-0.2.0.tar.gz:
Publisher:
publish-pypi.yml on macalbert/envilder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envilder-0.2.0.tar.gz -
Subject digest:
efe67257109c34d127b1a1d3a50974639ecce6cfd899e4b26337de12563644e8 - Sigstore transparency entry: 1310465176
- Sigstore integration time:
-
Permalink:
macalbert/envilder@5e526332aab8cc7fc5d787367902dad4de50ed9b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/macalbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e526332aab8cc7fc5d787367902dad4de50ed9b -
Trigger Event:
push
-
Statement type:
File details
Details for the file envilder-0.2.0-py3-none-any.whl.
File metadata
- Download URL: envilder-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8849c6dde241192ed31b0d753ac23589dfbe32f07bb78852fb60c9f9b06770bd
|
|
| MD5 |
e25b76c533c333b40adfa6d3dc13db26
|
|
| BLAKE2b-256 |
fa47be269c7e2535be113fd128c1b3ff23aa0df5ac421e6a44438ba13ab24415
|
Provenance
The following attestation bundles were made for envilder-0.2.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on macalbert/envilder
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
envilder-0.2.0-py3-none-any.whl -
Subject digest:
8849c6dde241192ed31b0d753ac23589dfbe32f07bb78852fb60c9f9b06770bd - Sigstore transparency entry: 1310465228
- Sigstore integration time:
-
Permalink:
macalbert/envilder@5e526332aab8cc7fc5d787367902dad4de50ed9b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/macalbert
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@5e526332aab8cc7fc5d787367902dad4de50ed9b -
Trigger Event:
push
-
Statement type: