Package containing a standard format for the logging module.
Project description
logsteplib
Package Description
Package containing a standard format for the logging module.
Usage
from a script:
from logsteplib.log_config import LogConfig
from logsteplib.db_metadata import DQMetadata
from logsteplib.dq_exceptions import SchemaMismatch, EmptyFile
# Standard Logger: Setup logger
from logsteplib.log_config import LogConfig
logger = LogConfig(name="my_process").logger
logger.info(msg="Starting data quality process...")
# Retrieve the standard log message format string
log_format = log_config.get_std_fmt()
print("Log format:", log_format)
# DQ: Create metadata object
from logsteplib.db_metadata import DQMetadata
metadata = DQMetadata(
target="sales_folder",
key="2025Q3",
input_file_name="raw_sales.csv",
file_name="clean_sales.csv",
user_name="John Doe",
user_email="john.doe@example.com",
modify_date="2025-10-24",
file_size=2048,
file_row_count=15000,
status="accepted",
rejection_reason=None,
file_web_url="https://example.com/files/clean_sales.csv"
)
logger.info(msg="Metadata created:")
logger.info(msg=metadata.to_json())
# DQ: Raise a custom exception (example)
from logsteplib.dq_exceptions import SchemaMismatch, EmptyFile
try:
raise SchemaMismatch()
except SchemaMismatch as e:
logger.error(msg=f"Data quality error: {e}")
Installation
Install python and pip if you have not already.
Then run:
pip install pip --upgrade
For production:
pip install logsteplib
This will install the package and all of it's python dependencies.
If you want to install the project for development:
git clone https://github.com/aghuttun/logsteplib.git
cd logsteplib
pip install -e ".[dev]"
To test the development package: Testing
License
BSD License (see license file)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file logsteplib-0.0.5.tar.gz.
File metadata
- Download URL: logsteplib-0.0.5.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5313e87cfdcf21aa1c7c9992a9ce80994c679b9db144d0f7378c232c07cd2b57
|
|
| MD5 |
8ef97fe09863217eaf1f8184e611dea1
|
|
| BLAKE2b-256 |
a2733e4113d54d3dac0d2c6baf44f7c90fafc4946e8bb622f8f56898d2013e4c
|
File details
Details for the file logsteplib-0.0.5-py3-none-any.whl.
File metadata
- Download URL: logsteplib-0.0.5-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc4b61a22aa2e42c0f1ffd8d04f84d7a20935d57c548ed9eef98a7747774001b
|
|
| MD5 |
23bd3bc0a3e5c4d867036ab3b0103da3
|
|
| BLAKE2b-256 |
70c1d68b723937b01474c502615542c4bdb479187be82158accb9728dcb1649f
|