A library to map dataclass and environmental variables
Reason this release was yanked:
There was an issue in setup.py.
Project description
envclasses
envclasses
is a library to map fields on dataclass object to environment variables.
Installation
pip install envclasses
Usage
Declare a class with dataclass
and envclass
decorators.
from envclasses import envclass
from dataclasses import dataclass
@envclass
@dataclass
class Foo:
v: int
foo = Foo(i=10)
load_env(foo, prefix='foo')
print(foo)
Run the script
$ python foo.py
Foo(i=10)
Run with environment variable
$ FOO_V=100 python foo.py
Foo(i=100)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
envclasses-0.2.5.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for envclasses-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f697acbf039869b570d8dd8ca926e7486b330e35942e2a3b58af84154ea539ce |
|
MD5 | feb27c0a70a9205a305cd6cceaf5075c |
|
BLAKE2b-256 | b2528444c4c94bff72304193f4099a97b63a37c2e86939d06113371b0740ac68 |