mirror of
https://github.com/Steffo99/cfig.git
synced 2024-12-22 22:24:21 +00:00
Compare commits
3 commits
ce282c9fd7
...
96903b97e3
Author | SHA1 | Date | |
---|---|---|---|
|
96903b97e3 | ||
dc5779f1bc | |||
eaa3aad5e7 |
2 changed files with 9 additions and 29 deletions
BIN
.media/icon-128x128_round.png
Normal file
BIN
.media/icon-128x128_round.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.1 KiB |
38
README.md
38
README.md
|
@ -1,35 +1,15 @@
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
![](.media/icon-128x128_round.png)
|
||||||
|
|
||||||
# cfig
|
# cfig
|
||||||
|
|
||||||
A configuration manager for Python
|
Configuration helper for Python
|
||||||
|
|
||||||
\[ [**Example**](https://github.com/Steffo99/cfig/tree/main/cfig/sample) | [**Documentation**](https://cfig.readthedocs.io/) | [**PyPI**](https://pypi.org/project/cfig/) \]
|
</div>
|
||||||
|
|
||||||
```python
|
## Links
|
||||||
import cfig
|
|
||||||
|
|
||||||
config = cfig.Configuration()
|
[![PyPI](https://img.shields.io/pypi/v/cfig)](https://pypi.org/project/cfig)
|
||||||
|
|
||||||
@config.required()
|
[![Documentation](https://img.shields.io/readthedocs/cfig)](https://cfig.readthedocs.io/en/latest/)
|
||||||
def SECRET_KEY(val: str) -> str:
|
|
||||||
"""Secret string used to manage HTTP session tokens."""
|
|
||||||
return val
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
config.cli()
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
from mypackage.mycfig import SECRET_KEY
|
|
||||||
|
|
||||||
print(f"My SECRET_KEY is: {SECRET_KEY}")
|
|
||||||
```
|
|
||||||
|
|
||||||
```console
|
|
||||||
$ python -m mypackage.mycfig
|
|
||||||
===== Configuration =====
|
|
||||||
|
|
||||||
SECRET_KEY → Required, but not set.
|
|
||||||
Secret string used to manage HTTP session tokens.
|
|
||||||
|
|
||||||
===== End =====
|
|
||||||
```
|
|
||||||
|
|
Loading…
Reference in a new issue