agenv
A simple Python package for securely loading environment variables from age encrypted file.
Installation
Basic Installation (Decryption Only)
If you only need to decrypt files at runtime:
pip install agenv
With dotenv Support (Load Encrypted Environment Variables)
If you need to load encrypted environment variables automatically:
pip install agenv[dotenv]
Usage
Loading Environment Variables
from agenv import load_age_env
# Decrypts and loads environment variables from a .env.age file
load_age_env(".env.age")
Decrypting and Loading YAML Data
import yaml
from agenv import decrypt
# Decrypts the .age encrypted file and loads the content as a YAML object
yaml_str = decrypt("database.yml.age")
data = yaml.safe_load(yaml_str)
print(data)
Identity Key Selection Order
agenv determines the age identity key in the following order:
- The
identityparameter provided toload_age_env() - The
AGE_SECRET_KEYenvironment variable - The
AGE_SECRET_KEY_FILEenvironment variable (path to key file) - The default key file:
$HOME/.age/age.key
If no valid identity is found, decryption will fail.
License
Metadata
Release files for agenv 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agenv-0.5.0.tar.gz | 4.4 kB | With provenance | Details for agenv-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agenv-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for agenv-0.5.0-py3-none-any.whl |
Total release size: 9.6 kB
Release files / agenv-0.5.0.tar.gz
| Download URL | agenv-0.5.0.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ad27e49afd79e07ccf2e4df9852d209ec23a2fc52d27635ee4ad188eb5faec1
|
|
BLAKE2b-256 checksum How to use checksums |
48017f0474589d8d47c5a7f523b6714a5cc3e1fa77819bd9723aaa762c764652
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logRelease files / agenv-0.5.0-py3-none-any.whl
| Download URL | agenv-0.5.0-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bfbd3b077ec4f2f370e20d35bb04dc436e2e0f19a16dee2f300d2586e4dc53d
|
|
BLAKE2b-256 checksum How to use checksums |
01a3746a34618de480257ad5b9d8f275746a74b47b344092b8635fcea00b295f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logSecurity for agenv 0.5.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agenv-0.5.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.
Transparency logA 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.