Quickly and efficiently load environment variables into a class
Project description
lenv
Welcome to the lenv package page! This package allows you to quickly, efficiently and conveniently load environment variables into a class!
Features
- Loading variables into a class by variable name
- Loading variables into a class by variable value
- Configurability
Installation
To install/update the lenv
package, you need to use pip
python3 -m pip install -U python-lenv
Usage/Examples
First, we'll look at the structure of your project, which should look like this
my-awesome-project
├── .env
└── main.py
Let's go to the file where the variables will be loaded into your class. We will name it .env
and put the following content inside
/* .env */
KEY=value
Let's move on to the most important thing, namely our python script where environment variables will be loaded from the .env
file we created earlier
# main.py
from lenv import Meta
class Config(metaclass=Meta):
KEY: str
print(Config.KEY) # value
License
lenv
is distributed under the terms of the MIT license.
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
Built Distribution
Hashes for python_lenv-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c35d165b4a9fc009525d37a2180edb4b2cc6fb3b76e3711b5c97839574f43edf |
|
MD5 | 796f0c185f47ac073d4e5cb8d5ed0040 |
|
BLAKE2b-256 | 15f3b3b0e79d1ecf8360f621603e58f502ec2049a652847c15ad1de3095e8d85 |