Load configuration from the environment for your python app.
Project description
DEPRECATED
This package is deprecated. pydantic provides the same featureset and much more.
Python set-ings
Load configuration from the environment for your python app. Supports typecasting and default values. Settings are made available in a way which plays nicely with IDEs and is easy to read.
Installation
pipenv install python-set-ingsorpip install python-set-ings
Usage
# my_app/settings.py
from set_ings import Property
from set_ings import Settings as SettingsBase
Settings(SettingsBase):
_PREFIX = 'YOUR_PREFIX'
FOO = Property(10, cast=int)
BAR = Property()
settings = Settings()
Then make sure you set the environment variables defined in your settings.
For the example above you would have to set YOUR_PREFIX_BAR and optionally
YOUR_PREFIX_FOO.
To use the settings anywhere in your app:
from my_app.settings import settings
print(settings.FOO + 2)
Contributing
Installation
git clone git@github.com:evocount/python-set-ings.gitcd python-set-ingspipenv install --dev
Running tests
pipenv run pytest --cov
License
This project is licensed under 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python-set-ings-0.2.2.tar.gz.
File metadata
- Download URL: python-set-ings-0.2.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a6f697b1a882311d4db94820304ecbe9681f85a89cefec830087276a0c833c0
|
|
| MD5 |
c35d05153813467791d1e0051ab2d3a5
|
|
| BLAKE2b-256 |
b428e48ea296bd424f3f58b7179d15bc70cda992e1e7c6eb07485b3b859a8f3d
|
File details
Details for the file python_set_ings-0.2.2-py2.py3-none-any.whl.
File metadata
- Download URL: python_set_ings-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb8a0c1d5e3b57456cfd0f1255556cf392f5dc3376fe4fba8e7ea97c7b47f58d
|
|
| MD5 |
72609b0a2b24dbbfb6ed7146db8f9eff
|
|
| BLAKE2b-256 |
3942160fcd04534f26e55c9ab032cf566e85b215d831c42860b1399d4d0436b1
|