Configuration helper for Python
|
All checks were successful
Test with Pytest the Python package using Poetry / Run tests (push) Successful in 13s
|
||
|---|---|---|
| .forgejo/workflows | ||
| .idea | ||
| .media | ||
| .vscode | ||
| cfig | ||
| docs | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| cfig.iml | ||
| LICENSE.txt | ||
| poetry.lock | ||
| pyproject.toml | ||
| README.md | ||
Cfig
Configuration helper for Python
Example
import cfig
config = cfig.Configuration()
@config.required()
def MAX_USERS(val: str) -> int:
"""The maximum number of users that will be able to login to this application."""
try:
return int(val)
except (ValueError, TypeError):
raise cfig.InvalidValueError("Not an int.")
if __name__ == "__main__":
config.cli()
$ python -m myproject.mydefinitionmodule
===== Configuration =====
MAX_USERS → Required, but not set.
The maximum number of users that will be able to login to this application.
===== End =====
See the quickstart guide for more information.
Why?
To make containerizing applications less of a pain.