EasyWorkEnv
The simplest way to manage environment variables in Python.
Load .env, .json, and .yaml config files in one line of code.
Access your variables with clean dot notation — no more os.getenv() boilerplate.
Why EasyWorkEnv?
Managing environment variables in Python shouldn't be painful. Most solutions either force you into a single file format, require verbose syntax, or lack support for nested configurations.
EasyWorkEnv solves this by providing:
- Multi-format support —
.env,.json, and.yamlout of the box - Dot notation access —
config.DATABASE.HOSTinstead ofconfig["DATABASE"]["HOST"] - Nested configuration — structure your settings with unlimited depth
- Zero config — just point to your file, it works
- Lightweight — only one dependency (
PyYAML) - Python 3.8+ compatible
Installation
pip install easyworkenv
Quick Start
from EasyWorkEnv import Config
config = Config(".env")
# Access your variables directly as attributes
print(config.API_KEY)
print(config.DATABASE_URL)
That's it. One import, one line of setup.
Usage Examples
.env file
# .env
APP_NAME=MyApp
SECRET_KEY=super-secret-value
DEBUG=true
DATABASE_URL=postgresql://localhost:5432/mydb
from EasyWorkEnv import Config
config = Config(".env")
print(config.APP_NAME) # "MyApp"
print(config.SECRET_KEY) # "super-secret-value"
print(config.DATABASE_URL) # "postgresql://localhost:5432/mydb"
.json file (with nested config)
{
"APP_NAME": "MyApp",
"DATABASE": {
"HOST": "localhost",
"PORT": 5432,
"NAME": "mydb"
},
"API_KEY": "sk-abc123"
}
from EasyWorkEnv import Config
config = Config("config.json")
print(config.APP_NAME) # "MyApp"
print(config.DATABASE.HOST) # "localhost"
print(config.DATABASE.PORT) # 5432
print(config.API_KEY) # "sk-abc123"
.yaml file (with nested config)
# config.yaml
APP_NAME: MyApp
DATABASE:
HOST: localhost
PORT: 5432
NAME: mydb
REDIS:
URL: redis://localhost:6379
from EasyWorkEnv import Config
config = Config("config.yaml")
print(config.APP_NAME) # "MyApp"
print(config.DATABASE.HOST) # "localhost"
print(config.REDIS.URL) # "redis://localhost:6379"
Supported File Formats
| Format | Extension | Nested Config | Comments |
|---|---|---|---|
| dotenv | .env |
No | Yes |
| JSON | .json |
Yes | No |
| YAML | .yaml |
Yes | Yes |
Contributing
Contributions are welcome! If you'd like to help improve EasyWorkEnv:
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Commit your changes (
git commit -m "Add my feature") - Push to the branch (
git push origin feature/my-feature) - Open a Pull Request
License
This project is licensed under the GNU General Public License v3.0 — see the LICENSE file for details.
Made by Hugo Galley
Release files for easyworkenv 0.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| easyworkenv-0.3.7.tar.gz | 16.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| easyworkenv-0.3.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.2 kB
Release files / easyworkenv-0.3.7.tar.gz
| Download URL | easyworkenv-0.3.7.tar.gz |
|---|---|
| Size | 16.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
31a40f36082d9db5ff06560e46b51d4047afbfc3ab16b3285c80b93ba84459d2
|
|
BLAKE2b-256 checksum How to use checksums |
ecb7c933c8e2ce18f80d0ce6fc0b7cc60c947a9bbf139048c9c4b808e2c13e8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / easyworkenv-0.3.7-py3-none-any.whl
| Download URL | easyworkenv-0.3.7-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f5e94764f255923dad2b8b5cbe64e1c64f3a8007d2fa4fb7dbcd3428bdb7831
|
|
BLAKE2b-256 checksum How to use checksums |
62d94b7067e5b30cc8304fa61d700ee8c34c337dcd1d10887213f52717a2326f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|