Registry / devops / python-envcfg

python-envcfg

JSON →
library0.2.0pypypi✓ verified 85d ago

Python EnvCFG (python-envcfg) provides a 'magic module' for accessing environment variables as attributes, automatically converting them to common Python types (str, int, float, bool). It also supports loading configuration from YAML files. The current version is 0.2.0, released in 2017, and the project appears to be no longer actively maintained.

pip install python-envcfg
INSTALL
IMPORT
SIG · PYTHON-ENVCFG
P
python-envcfg
devopspythonv0.2.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

env
import envcfg
from envcfg import env

This quickstart demonstrates how to access environment variables using the `env` magic module, including automatic type conversion and providing default values for unset variables. Note that environment variables must be set in `os.environ` before `envcfg` processes them.

import os from envcfg import env # Simulate setting environment variables for demonstration os.environ['DATABASE_URL'] = 'postgres://user:password@host:port/database' os.environ['DEBUG'] = 'true' os.environ['PORT'] = '8000' print(f"Database URL: {env.DATABASE_URL} (type: {type(env.DATABASE_URL)})") print(f"Debug Mode: {env.DEBUG} (type: {type(env.DEBUG)})") # Auto-converts 'true' to True print(f"Port Number: {env.PORT} (type: {type(env.PORT)})") # Auto-converts '8000' to 8000 # Accessing an undefined variable with a default app_env = env.APP_ENV('development') print(f"App Environment: {app_env} (type: {type(app_env)})") # Example of retrieving an explicitly string value: string_port = env.PORT('default_string_port') # Ensures string type print(f"Port as String: {string_port} (type: {type(string_port)})")
Debug
Known issues
gotchaProject Abandonment: `python-envcfg` has not been updated since 2017 and is no longer actively maintained. This means no new features, bug fixes, or security updates are to be expected.
fix
Consider using actively maintained alternatives like `os.getenv`, `python-decouple`, `dynaconf`, or `pydantic-settings` for robust environment variable management.
affects: 0.2.0 and earlier
gotchaPotential Python Version Incompatibility: While `0.2.0` listed Python 3 support, it has not been tested or updated for modern Python versions (e.g., 3.9+). Users may encounter unexpected runtime errors or deprecated syntax issues.
fix
Thoroughly test `python-envcfg` in your target Python environment. Be prepared to switch to an alternative if compatibility issues arise.
affects: 0.2.0
gotchaImplicit Type Conversion Risks: EnvCFG automatically converts environment variable strings to `bool`, `int`, or `float`. This can lead to unexpected values (e.g., '0' becoming `False`, 'false' becoming `False`) if the intended value was a string.
fix
Always verify the types of retrieved values. Use the default value mechanism `env.VAR('default_string')` to explicitly retrieve a string or manually convert if necessary.
affects: 0.2.0
Upgrade
Version history
0.2.0latest on PyPI · released Jul 7, 2016
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
python-envcfg — pip install python-envcfg · libregistry