3 Commits

Author SHA1 Message Date
Daniel Tomlinson
2942e36e60 add todo 2022-10-10 21:27:55 +01:00
f3df6290c1 chore: add simple env script example to README 2022-05-15 21:50:33 +01:00
7b2b895309 chore: add badges to README.md 2022-01-30 17:33:25 +00:00
2 changed files with 31 additions and 0 deletions

View File

@@ -1,5 +1,8 @@
# Panaetius # Panaetius
![PyPI](https://img.shields.io/pypi/v/panaetius)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/panaetius)
This package provides: This package provides:
- Functionality to read user variables from a `config.yml` or environment variables. - Functionality to read user variables from a `config.yml` or environment variables.
@@ -80,6 +83,8 @@ tembo.cli.CONFIG
### Script ### Script
#### with config file
Create `./config/config.yml` in the same directory as the script. Create `./config/config.yml` in the same directory as the script.
In the script initialise a `CONFIG` object: In the script initialise a `CONFIG` object:
@@ -96,6 +101,16 @@ CONFIG = panaetius.Config(
Set variables in the same way as the module above. Set variables in the same way as the module above.
####  with env vars only
```python
import panaetius
CONFIG = panaetius.Config("mart")
panaetius.set_config(CONFIG, "username")
panaetius.set_config(CONFIG, "password")
```
#### quickstart logging #### quickstart logging
```python ```python

16
docs/todo.todo Normal file
View File

@@ -0,0 +1,16 @@
Features:
☐ Add simple one-line logger
☐ Try Typer
<https://typer.tiangolo.com/>
One-line logger
```
LOGGER = panaetius.set_logger(
CONFIG,
panaetius.CustomLogger(
logging_format='{"time": "%(asctime)s", "logging_level":"%(levelname)s", "message": "%(message)s"}',
logging_level=CONFIG.logging_level,
),
)
```