Skip to main content

This is a package that simplifies environment variable management.

Project description

EasyWorkEnv

The simplest way to manage environment variables in Python.

PyPI version Python License: GPL v3

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 .yaml out of the box
  • Dot notation accessconfig.DATABASE.HOST instead of config["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:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit your changes (git commit -m "Add my feature")
  4. Push to the branch (git push origin feature/my-feature)
  5. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

easyworkenv-0.3.7.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easyworkenv-0.3.7-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file easyworkenv-0.3.7.tar.gz.

File metadata

  • Download URL: easyworkenv-0.3.7.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for easyworkenv-0.3.7.tar.gz
Algorithm Hash digest
SHA256 31a40f36082d9db5ff06560e46b51d4047afbfc3ab16b3285c80b93ba84459d2
MD5 c88c8003e6b7dd672245629438cd7886
BLAKE2b-256 ecb7c933c8e2ce18f80d0ce6fc0b7cc60c947a9bbf139048c9c4b808e2c13e8a

See more details on using hashes here.

File details

Details for the file easyworkenv-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: easyworkenv-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.6

File hashes

Hashes for easyworkenv-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 5f5e94764f255923dad2b8b5cbe64e1c64f3a8007d2fa4fb7dbcd3428bdb7831
MD5 ce31abfc33e7d049feb3325df18640ff
BLAKE2b-256 62d94b7067e5b30cc8304fa61d700ee8c34c337dcd1d10887213f52717a2326f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page