Skip to main content

python-kv-dotenv

python-kv-dotenv is a small wrapper around python-dotenv that resolves Azure Key Vault secret references while loading .env files.

It keeps python-dotenv file discovery and variable interpolation behavior, and adds support for wrapped Key Vault URLs in env values.

Install

pip install python-kv-dotenv

Supported kv: format

kv:https://<vault>.vault.azure.net/secrets/<secret-name>
kv:https://<vault>.vault.azure.net/secrets/<secret-name>/<secret-version>

Example

.env

MAXIMO_CONNSTRING=kv:https://example.vault.azure.net/secrets/maximo-prod-connstring
ENV=dev

Python:

import os

from python_kv_dotenv import load_kv_dotenv

load_kv_dotenv()

print(os.environ["ENV"])
print("MAXIMO_CONNSTRING" in os.environ)

Authentication

Secret resolution uses azure.identity.DefaultAzureCredential by default.

You can also pass a custom Azure credential:

from azure.identity import DefaultAzureCredential

from python_kv_dotenv import load_kv_dotenv

load_kv_dotenv(credential=DefaultAzureCredential())

Notes

  • Non-kv: values are loaded like normal python-dotenv values.
  • kv: references are resolved before later ${VAR} interpolation uses them.
  • Secret lookup failures are fail-fast and raise the underlying Azure error.

Metadata

Release files for python-kv-dotenv 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-kv-dotenv 0.1.1
File Size Uploaded Provenance Actions
python_kv_dotenv-0.1.1.tar.gz 4.2 kB Without provenance Details for python_kv_dotenv-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-kv-dotenv 0.1.1
File Interpreter ABI Platform Actions
python_kv_dotenv-0.1.1-py3-none-any.whl Python 3 none any Details for python_kv_dotenv-0.1.1-py3-none-any.whl

Total release size: 10.1 kB

Release files / python_kv_dotenv-0.1.1.tar.gz

Download URL python_kv_dotenv-0.1.1.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8b3bb7c3e579c82a128fe32a9c3e5a04d38eb6ba019f415e5feb65642d7de85b
BLAKE2b-256 checksum
How to use checksums
0d2857b8fac3ee061eb8c85c80c401ddfd2bef6f5233cca94372b490cfe5de8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Release files / python_kv_dotenv-0.1.1-py3-none-any.whl

Download URL python_kv_dotenv-0.1.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
26bd5e746456d657dcc74f25a603da5887ba9ed7b971f8da56461ff0691a7b81
BLAKE2b-256 checksum
How to use checksums
68803bed047eddcc123717921ab5205224eb9991298c80d697b48ef65110282b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Security for python-kv-dotenv 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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