Skip to main content

Awesome Environment Manager

A Python utility for automatically managing environment variables with type safety and easy configuration.

Description

Environment Manager provides a simple yet powerful way to handle environment variables in Python applications through type-hinted class attributes. It automatically loads environment variables and converts them to the correct types based on your type hints.

Features

  • 🔒 Type-safe environment variable handling
  • 🔄 Automatic type conversion
  • 📝 Support for .env files (via python-dotenv)
  • 🎯 Support for various data types:
    • Basic types (str, int, float, etc.)
    • Boolean values with flexible input formats
    • Lists with type hints (using semicolon as separator)
    • Dictionaries (key-value pairs)

Installation

bash pip install awesome-environment-manager

or using uv

uv pip install awesome-environment-manager

Quick Start

from aem import EnvironmentClass

class AppConfig(EnvironmentClass):
  DATABASE_URL: str = "postgresql://localhost"
  PORT: int = 8080
  DEBUG: bool = False
  ALLOWED_HOSTS: list[str] = ["localhost", "127.0.0.1", "example.com"]
  DB_CONFIG: dict = {"host": "localhost", "port": "5432", "name": "mydb"}

Create an instance - environment variables will be loaded automatically

os.environ["PORT"] = 8282

config = AppConfig()
print(config.DATABASE_URL) # => postgresql://localhost
print(config.PORT) # => 8282

Environment Variable Formats

  • Strings: Simple string values

    DATABASE_URL=postgresql://localhost:5432/db
    
  • Numbers: Will be converted to int/float

    PORT=8080
    
  • Booleans: Supports various formats

    DEBUG=true  # Also accepts: 1, yes, y, on
    
  • Lists: Use semicolons as separators

    ALLOWED_HOSTS=localhost;127.0.0.1;example.com
    
  • Dictionaries: Use semicolons between pairs and colons between keys and values

    DB_CONFIG=host:localhost;port:5432;name:mydb
    

.env Support

The package automatically supports .env files if python-dotenv is installed:

pip install python-dotenv

Then create a .env file:

DATABASE_URL=postgresql://11.22.33.44
DEBUG=1

Result

config = AppConfig()
print(config.DATABASE_URL) # => postgresql://11.22.33.44
print(config.PORT) # => 8080
print(config.DEBUG) # => True

License

This project is licensed under the European Union Public License v1.2 (EUPL-1.2).

Metadata

Release files for awesome-environment-manager 1.0.0

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

Source distribution (sdist)

Source distribution for awesome-environment-manager 1.0.0
File Size Uploaded Provenance
awesome_environment_manager-1.0.0.tar.gz 10.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awesome-environment-manager 1.0.0
File Interpreter ABI Platform
awesome_environment_manager-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.2 kB

Release files / awesome_environment_manager-1.0.0.tar.gz

Download URL awesome_environment_manager-1.0.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cac28e84b6dc1f9e56585269eb982ce92de2b2548f464d996324235b1991faa6
BLAKE2b-256 checksum
How to use checksums
539b9665a1d93c52beb5b99f33722fd3ca6a80550fde794e58ba9cf063acff8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.4

Release files / awesome_environment_manager-1.0.0-py3-none-any.whl

Download URL awesome_environment_manager-1.0.0-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d464c0d838001d8b87dec090e7eeb0095abc40d830a936471fefd4423885526
BLAKE2b-256 checksum
How to use checksums
6ddc293644fd4a4e59959ce164340db85aa4166f580975b540b3a39a8610a59a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.4

Security for awesome-environment-manager 1.0.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.

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

1.0.0 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