Envotate
Work in progress
Settings management using environment variables and type annotations. This intended to support both class-based and module-based configurations.
Example
Define a configuration like this:
# app/settings.py
from envotate.env import Env, env
from envotate.types import Choice, Default
@env
class Database:
DB_USER: str
DB_PASSWORD: str
DB_HOST: str
DB_PORT: int
DB_NAME: str
PY_39 = "py39"
PY_310 = "py310"
@env
class Settings:
DATABASE: Database
DEBUG: bool = False
PY_VERSION: Env[str, Choice([PY_39, PY_310]), Default(PY_39)]
Then access it in an application:
# app/main.py
from app.settings import Settings
def main():
print(Settings.DATABASE.DB_NAME)
if __name__ == "__main__":
main()
Metadata
Release files for envotate 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| envotate-0.0.1.tar.gz | 8.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| envotate-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.8 kB
Release files / envotate-0.0.1.tar.gz
| Download URL | envotate-0.0.1.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c9adbc51e2667c035cfa724c3cf62f74135e2db69ae3c5a9d744e19ce37e8e9
|
|
BLAKE2b-256 checksum How to use checksums |
af5c8b94e4f9c75870dee5ba6a6248eddedc90acc5350065bfae5f2b3a84328d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|
Release files / envotate-0.0.1-py3-none-any.whl
| Download URL | envotate-0.0.1-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f9a11c95dff368002fb83346be37f9f74ee8668cb870c662f59a198b156a325
|
|
BLAKE2b-256 checksum How to use checksums |
aab2a93241a9035b8f7eafc7e6dd037a1bc3d01e40012e0ab9036ef4d65120b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.8.12
|