A super simple python app framework that includes a logger and a config manager. Also usable in jupyter notebook.
Project description
loe-simp-app-fw
A super simple python app framework that includes a logger and a config manager. This framework is also useable in Jupyter Notebook.
Example
a typical project that uses this framework
project
├── config-example.yaml
├── config.yaml
├── LICENSE
├── log
│ └── 2024-04-16.log
├── README.md
├── src
│ └── main.py
└── tests
└── test_import.py
Loading
import os
from loe_simp_app_fw.config import Config
from loe_simp_app_fw.logger import Logger
Config("config.yaml", example_config_path="config-example.yaml", project_root_path=os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
Logger("log", project_root_path=os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
It will read from
[project root path]/"config.yaml"
The example config is located at
[project root path]/"config-example.yaml"
The log file will be at
[project root path]/"log"/yyyy-mm-dd.log
Basic Usage
Logger usage
Logger.debug("This is a debug message.")
Logger.info("This is a info message.")
Logger.warning("This is a warning message.")
Logger.error("This is a error message.")
Config usage
something = Config.config["project root path"]
Advance Usage
Config hot reload
Config("another-config.yaml")
.gitignore
log/
config*.yaml
!config-example.yaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
loe_simp_app_fw-1.5.1.tar.gz
(19.6 kB
view hashes)
Built Distribution
Close
Hashes for loe_simp_app_fw-1.5.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e229ef81873d29252366211d219a4089e9ee2fbb5ec65341f406678a0ab5b27 |
|
MD5 | dea271eedc8bb1f0a9c1cafd2c15cc1b |
|
BLAKE2b-256 | 38f81c81e0b0568e480c8ae2f53a09433cb475a0ea0b7fa2cb745817b55c19d6 |