Catalog PyPI
Back to packageRELEASE DETAILS

0.5.0

PyPI

agenv

Load environment variables from age-encrypted files

Published17 Apr 2025
Direct dependencies1
Transitive dependenciesNot calculated

README

Version 0.5.0 documentation

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]

[!NOTE] age must be installed separately, as there is no native Python implementation of age.

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:

  1. The identity parameter provided to load_age_env()
  2. The AGE_SECRET_KEY environment variable
  3. The AGE_SECRET_KEY_FILE environment variable (path to key file)
  4. The default key file: $HOME/.age/age.key

If no valid identity is found, decryption will fail.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 1

Native requirements
1 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
python-dotenv
Environment
{
  "extras": "",
  "marker": "extra == \"dotenv\"",
  "requires_python": ">=3.7",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv; extra == "dotenv"runtime

Distribution files

2 collected
agenv-0.5.0-py3-none-any.whl

bdist_wheel · 5.06 KB · Python py3

Source file
agenv-0.5.0.tar.gz

sdist · 4.31 KB · Python source

Source file

Repository

PENDING
zachcheung/agenv

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:01 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:eb747ebecc6283f767e70055b5d5a0af392897feae299bd514b71428a37783db

Other collected versions

View all collected versions →