Auro Utils is a utility package offering various practical supports for the Auromix application, such as enhanced logging capabilities and more.
Project description
auro_utils
Auro Utils is a utility toolkit, providing enhanced logging, performance profiling, etc.
Install
Install from pip
pip install auro_utils
Install from source
git clone https://github.com/Auromix/auro_utils
cd auro_utils
pip install -e .
Test
cd auro_utils
python3 -m pytest -v .
Usage
Following are some simplified examples of utilities offered by this package.
You can also find detailed examples in the examples
folder.
cd auro_utils/examples
Loggers
logger
Logger is a class that can be used to log messages to the console and to a file. It is a wrapper around loguru.
from auro_utils.loggers.logger import Logger
my_logger = Logger()
my_logger.log_info("This is a info log test.")
classic logger
Classic logger is a class that can be used to log messages to the console and to a file. It is a wrapper around the standard python logging module.
from auro_utils.loggers.logger_classic import Logger
my_logger = Logger()
my_logger.log_info("This is a info log test.")
Profilers
profiler
Decorator for profiling and analyzing performance of functions. It is a wrapper around yappi.
from auro_utils.profilers.profiler import auro_profiler
@auro_profiler
def your_function_code():
import time
time.sleep(2)
IO
file_operator
Functions in file_operator can be used to read and write files and process paths.
# Get the project top level directory
from auro_utils.io.file_operator import get_project_top_level_dir
project_top_dir=get_project_top_level_dir()
print(project_top_dir)
# Read a toml file
from auro_utils.io.file_operator import read_toml
config = read_toml(project_top_dir+ "/config.toml")
print(config)
Install
pip install auro_utils
Troubleshooting
ModuleNotFoundError
Make sure you have installed the package correctly. See Install section.
Want to uninstall
pip uninstall auro_utils
Contribute
Please refer to CONTRIBUTING.md for more information.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file auro_utils-0.0.6.tar.gz
.
File metadata
- Download URL: auro_utils-0.0.6.tar.gz
- Upload date:
- Size: 18.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0abc380adbe368526a908e494cda74b3910b49632a59e76b0681887668df0f10 |
|
MD5 | 869c23fee6ecd29229c6b39bc36dda88 |
|
BLAKE2b-256 | ccade79b486f6e20c30da52ccf5acf02c11e3ee2a8eea2d327b890c8bd131956 |
File details
Details for the file auro_utils-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: auro_utils-0.0.6-py3-none-any.whl
- Upload date:
- Size: 25.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c312595578a222de5dba67a52923ff60cbe60d4c905cd41046363353a5b0d51 |
|
MD5 | 42557c63d894729ee28ae1f74cecfc73 |
|
BLAKE2b-256 | 7a028ba388de2887fb73607a3c36269326a814e278e8b45b10cadd3ba7d7f57e |