Skip to main content

No project description provided

Project description

dotenv-manager

A decorator for defining a set of environment variables. Uses the python-dotenv package to load additional variables from .env

The dotenv manager ensures the environment variables used in the project are set and have the correct types.

Getting Started

pip install dotenv-manger
from dotenv_manger import EnvManager

@EnvManager()
class CONFIG:
    KEY1: str
    KEY2: str
    INT_KEY: int

Using the prefix parameter, it is possible to use a common prefix and separate the variables in groups.

@EnvManager(prefix="AWS_")
class AWS_CONFIG:
    SECRET: str
    ENDPOINT: str

@EnvManager(prefix="AZURE_")
class AZURE_CONFIG:
    SECRET: str
    ENDPOINT: str

Using strict=False, an error message is printed to the terminal, instead of throwing an error.

@EnvManager(strict=False)
class CONFIG:
    NOT_FOUND_KEY: str
    ENDPOINT: str

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

dotenv_manager-0.1.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

dotenv_manager-0.1.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded Python 3

Supported by

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