Skip to main content

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

Python Versions Platform PypI Versions PyPI status Github Actions Test and Publish Status codecov License

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

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

bosos_dev_tools-0.1.2.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bosos_dev_tools-0.1.2-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file bosos_dev_tools-0.1.2.tar.gz.

File metadata

  • Download URL: bosos_dev_tools-0.1.2.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for bosos_dev_tools-0.1.2.tar.gz
Algorithm Hash digest
SHA256 aed9b3b1031b35f7a1b2a76c8146e8e9b8a4638e563856a836a63118b574028d
MD5 f0264e773cf7f43db222f8c252758672
BLAKE2b-256 f00d39da9e785e0c35aa3a9e9a41013a53c44130a6739c1da8bd0d0b0f6b8eda

See more details on using hashes here.

File details

Details for the file bosos_dev_tools-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for bosos_dev_tools-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 223c3a97403cfca4fb73eb6a6885c485aacfc4362769a90fea6025cd651a8633
MD5 e25e5c32f51255285af90a1fc0f31dfe
BLAKE2b-256 a856aa05d92a5d7c8f9ed22fc613dbe899eaa202e2042b1a0bc21c52baed039c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page