mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 13:05:45 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2942e36e60 | ||
| f3df6290c1 | |||
| 7b2b895309 |
15
README.md
15
README.md
@@ -1,5 +1,8 @@
|
||||
# Panaetius
|
||||
|
||||

|
||||

|
||||
|
||||
This package provides:
|
||||
|
||||
- Functionality to read user variables from a `config.yml` or environment variables.
|
||||
@@ -80,6 +83,8 @@ tembo.cli.CONFIG
|
||||
|
||||
### Script
|
||||
|
||||
#### with config file
|
||||
|
||||
Create `./config/config.yml` in the same directory as the script.
|
||||
|
||||
In the script initialise a `CONFIG` object:
|
||||
@@ -96,6 +101,16 @@ CONFIG = panaetius.Config(
|
||||
|
||||
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
|
||||
|
||||
```python
|
||||
|
||||
16
docs/todo.todo
Normal file
16
docs/todo.todo
Normal 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,
|
||||
),
|
||||
)
|
||||
```
|
||||
Reference in New Issue
Block a user