The general utils library for neomedsys development
Project description
NeoLibrary 🍦
The documentation describes the purpose and how to use the neolib. This documenation is also purposely written in a cute format to make it more fun to read. Ice cream to everyone who reads it.
The neolib is a library for the common functions that is used in the NeoMedSystem projects.
NeoLogger is the logger component that is compliant with Grafana Loki https://grafana.com/oss/loki/ and is used to log all events in the NeoMedSys projects. The logger is based on the python logging library and is easy to use.
The logger will save a logger file in the /logs directory for each file that uses the logger. These logfiles are deleted when the rotation day is reached. The default rotation day is 30 days. The logfiles are saved in the /logs directory.
The logger is imported as;
from neolibrary.monitoring.logger import NeoLogger
Utils contains all the utility functions that is used in the NeoMedSys projects. Such as hash functions, datetime cleanup, etc.
utils are imported as;
import neolibrary.utils as utils
Decorators contains all the decorators that is used in the NeoMedSys projects. Such as timer, etc. These are special functions that can be used to decorate other functions such as shown below:
@timer
def my_function():
pass
decorators are imported as;
from neolibrary.decorators import timer
It is super easy to add logger to your project. Just add the following code to your project and you are good to go.
Use your favorite package manager. Here at NeoMedSys we use poetry.
$ poetry add neolibrary
Then add the following code below to your project. This enabled the logger with log rotation of 30 days (resets the logger for memory cleanup). The default is 30 days.
from neolibrary.monitoring import NeoLogger
logger = NeoLogger(__name__, rotate_days=30)
The library contains all functions that the the NeoMedSys pythonased project needs, such as:
from neolibrary.utils import my_function
something = my_function()
Neolibrary also contains functions for preprocessing data, such as:
from neolibrary.preproc import zscore
znorm = zscore(data)
See full documentation to see all functionality
This package uses Github workflow for CI/CD. Publication to pypi happens if a new release is created, except if the version includes alpha at the end of the version number.
The version should be changed in the pyproject.toml file. The version number should follow the Semantic Versioning standard.
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
Built Distribution
Hashes for neolibrary-0.4.3b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71b2386343cdd89fd30e829e9dd49621bd18a56045054550613d4b324c499e88 |
|
MD5 | a4934f40fae70dc1c33ce491a4e46b7e |
|
BLAKE2b-256 | c99df435f4b1601776199d82fa1896a9474ff5c832654f94d7013071a8e5873e |