Skip to main content

A tiny module to read environment variables and tranform them.

Project description

envyronment

A tiny module to read environment variables and tranform them.

When load_dotenv is available, this is called at import time.


Code style: Ruff Typing: Pyright Linting: Pylint License CI Validation


Features

  • ✅ Simple, typed API
  • ✅ Loads .env if installed with extra dotenv
  • ✅ Flexible casting via astype=...
  • ✅ Propagates errors raised in the astype callable
  • ✅ Zero dependencies required, python-dotenv optionally installed

Requirements

  • Python 3.10+ (only 3.13 is tested)

Quick start

  1. Install the package

    pip install envyronment
    

    or

    pip install envyronment[dotenv]  # Ensure python-dotenv is also installed
    
  2. Import and use

    import envyronment as env
    
    ascii_asterisk = env.read("ASCII_ASTERISK", 42, astype=int)  # typed as int, 42 by default
    debug = env.read("DEBUG", astype=bool)  # typed as bool, required
    

License

This project is licensed under the MIT License — see the LICENSE file for details.

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

envyronment-0.2.0.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

envyronment-0.2.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file envyronment-0.2.0.tar.gz.

File metadata

  • Download URL: envyronment-0.2.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envyronment-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ed0bafc790896f77a8ebe93cbb64fb6897923a67d1f424731040084e62bf4498
MD5 ad5afad22754c88d0a79bdbfbe0b5653
BLAKE2b-256 75e52408aa55621ca8b7cce8f7d3a474da62cfed49779ed426c3789bb5f4462d

See more details on using hashes here.

Provenance

The following attestation bundles were made for envyronment-0.2.0.tar.gz:

Publisher: release.yml on shifqu/envyronment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file envyronment-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: envyronment-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envyronment-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2997f392bc398808bdc5c5e111aad6e2522573bbe5d0c36fe55e6537ee95b1c8
MD5 2e5ab421a2243da55156d96789cfecd7
BLAKE2b-256 b8d6c7ab54014402764ebaaa858941f490e4007408c2ae243668f877e7b53536

See more details on using hashes here.

Provenance

The following attestation bundles were made for envyronment-0.2.0-py3-none-any.whl:

Publisher: release.yml on shifqu/envyronment

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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