mirror of
https://github.com/Steffo99/cfig.git
synced 2024-12-23 06:34:22 +00:00
Compare commits
1 commit
b44fdbc857
...
50be794c67
Author | SHA1 | Date | |
---|---|---|---|
|
50be794c67 |
4 changed files with 31 additions and 11 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
@ -26,7 +26,7 @@ jobs:
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
|
|
||||||
- name: "🔨 Setup Poetry"
|
- name: "🔨 Setup Poetry"
|
||||||
uses: abatilo/actions-poetry@v2.4.0
|
uses: abatilo/actions-poetry@v2.3.0
|
||||||
|
|
||||||
- name: "🔨 Setup Poetry Python environment"
|
- name: "🔨 Setup Poetry Python environment"
|
||||||
uses: Steffo99/actions-poetry-deps@v0.2.5
|
uses: Steffo99/actions-poetry-deps@v0.2.5
|
||||||
|
|
2
.github/workflows/tests.yml
vendored
2
.github/workflows/tests.yml
vendored
|
@ -46,7 +46,7 @@ jobs:
|
||||||
uses: actions/setup-python@v3
|
uses: actions/setup-python@v3
|
||||||
|
|
||||||
- name: "🔨 Setup Poetry"
|
- name: "🔨 Setup Poetry"
|
||||||
uses: abatilo/actions-poetry@v2.4.0
|
uses: abatilo/actions-poetry@v2.3.0
|
||||||
|
|
||||||
- name: "🔨 Setup Poetry Python environment"
|
- name: "🔨 Setup Poetry Python environment"
|
||||||
id: pyenv
|
id: pyenv
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 6.1 KiB |
38
README.md
38
README.md
|
@ -1,15 +1,35 @@
|
||||||
<div align="center">
|
|
||||||
|
|
||||||
![](.media/icon-128x128_round.png)
|
|
||||||
|
|
||||||
# cfig
|
# cfig
|
||||||
|
|
||||||
Configuration helper for Python
|
A configuration manager for Python
|
||||||
|
|
||||||
</div>
|
\[ [**Example**](https://github.com/Steffo99/cfig/tree/main/cfig/sample) | [**Documentation**](https://cfig.readthedocs.io/) | [**PyPI**](https://pypi.org/project/cfig/) \]
|
||||||
|
|
||||||
## Links
|
```python
|
||||||
|
import cfig
|
||||||
|
|
||||||
[![PyPI](https://img.shields.io/pypi/v/cfig)](https://pypi.org/project/cfig)
|
config = cfig.Configuration()
|
||||||
|
|
||||||
[![Documentation](https://img.shields.io/readthedocs/cfig)](https://cfig.readthedocs.io/en/latest/)
|
@config.required()
|
||||||
|
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