mirror of
https://github.com/dtomlinson91/panaetius.git
synced 2025-12-22 13:05:45 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 528f11c8eb | |||
|
|
709f1ae997 |
15
README.md
15
README.md
@@ -1,8 +1,5 @@
|
|||||||
# Panaetius
|
# 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.
|
||||||
@@ -83,8 +80,6 @@ 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:
|
||||||
@@ -101,16 +96,6 @@ 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
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
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