Decorator for convenient loading of environment variables
Project description
@environment
Decorator for convenient loading of environment variables
Free software: MIT license
Documentation: https://atenvironment.readthedocs.io.
Getting started
Install @environment from pip:
pip install atenvironment
Using @environment is as simple as:
from atenvironment import environment @environment('API_KEY', 'TOKEN') def check(a, b, c, key, token): # API_KEY is in key # TOKEN is in token
Then call the function as:
check(a, b, c)
Environment variables are checked and provided to the function. In case the token is not in environment an atenvironment.EnvironMiss exception is raised.
See the docummentation for more details.
History
0.1.0 (2018-06-12)
First release on PyPI.
0.2.0 (2018-06-24)
on error: optional function to be called if any of the environment tokens in value is not present in environment
in self: optional variable name in case instance property is to be initialized
package slightly restructured
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
Built Distribution
File details
Details for the file atenvironment-0.2.0.tar.gz
.
File metadata
- Download URL: atenvironment-0.2.0.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2390b61c65ad008c94f7f8d91932a390f708a5b80c7be8da74f8b1cdb9ae5663 |
|
MD5 | e7be7fef30e8c2ca5afb94bf285c4501 |
|
BLAKE2b-256 | 8eb9c58075a8c915224ad14cf7a447b95e60a874f9c49b6a88b01c3a15fc48c1 |
File details
Details for the file atenvironment-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: atenvironment-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aefd0835ad63deb83a19ef6fc444e62708ec6364eb0fbf0d0334abb2ac96ef88 |
|
MD5 | 20e4b67498762ae469ef1367f2f7dc0a |
|
BLAKE2b-256 | f1b12f47bed9e22fe85aae09f66e54ca54772facc299254eaf9b7419183f5d87 |