Dev Tools is a collection of utility tools for Python developers, designed to simplify debugging, logging, and monitoring tasks. This package includes custom logging handlers, decorators for measuring execution time, and a progress bar utility to enhance the development workflow.
Project description
Bosos Dev Tools
Bosos Dev Tools is a collection of utility tools for Python developers, designed to simplify debugging, logging, and monitoring tasks. This package includes custom logging handlers, decorators for measuring execution time, and a progress bar utility to enhance the development workflow.
Features
- Custom Logging Handlers: Log messages to various destinations, including databases, with customizable formats.
- Timing Decorators: Easily measure the execution time of your functions with minimal code changes.
- Progress Bar Utility: Visualize the progress of long-running operations in the console.
- Debug Tools: Check if debug or timing modes are enabled via environment variables.
Installation
You can install the package via pip:
pip install bosos-dev-tools
Usage
Custom Logging Handler
The LogDBHandler
allows you to log messages directly to a database.
import logging
from dev_tools.custom_handlers import LogDBHandler
logger = logging.getLogger('test_logger')
db_handler = LogDBHandler(db_table='test_table')
logger.addHandler(db_handler)
logger.setLevel(logging.INFO)
logger.info('This is a test log message.')
Timing Decorator
Use the timing_decorator
to measure the execution time of functions.
from dev_tools.custom_decorators import timing_decorator
@timing_decorator
def example_function():
for i in range(1000000):
pass
example_function()
Progress Bar
Use the progress_bar
to measure the execution time of functions.
from dev_tools.progress_bar import progress_bar
for item in progress_bar(range(10)):
pass
Debug Tools
Check if debug or timing modes are enabled via environment variables.
Use the logger_setup
to set up your logging settings at the beginning of the script.
from dev_tools.debug_tools import is_debug_on, is_timing_on
print('Is debug on:', is_debug_on())
print('Is timing on:', is_timing_on())
from dev_tools.debug_tools import logger_setup
def main():
logger_setup()
if __name__ == '__main__':
main()
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Links
- Source Code: GitHub Repository
- Issue Tracker: GitHub Issues
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
File details
Details for the file bosos_dev_tools-0.1.4.tar.gz
.
File metadata
- Download URL: bosos_dev_tools-0.1.4.tar.gz
- Upload date:
- Size: 10.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120213abcef0a30dbfeabf74d088649f493e6f0385992dc4a9d0c235d26c26f2 |
|
MD5 | 30a427cdb4ef58272d91652d6847c91d |
|
BLAKE2b-256 | 1643630ebcbdcbcd29e4c2a94ce8981e28876edad370c2fc961ead9c00a5bbef |
File details
Details for the file bosos_dev_tools-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: bosos_dev_tools-0.1.4-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89c1a652a8652aac60d4d6d0bd158e2aac1f072706393a54ba1664151b992efc |
|
MD5 | e6a91bdc55073cc9bb3f1ddfc125286b |
|
BLAKE2b-256 | a9bd036805e1aad7133919bee2f4ae0034de7685c4a1cf9005c63216d59bb29e |