Skip to main content

Dev Tools is a collection of utility tools for Python developers — logging, decorators, debugging, progress bars, a markdown link checker, and an AST-based code map generator.

Project description

Bosos Dev Tools

Python 3.10+ Platform PyPI Version PyPI status Test Version & Release 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 decorators for measuring execution time, a progress bar utility, structured file logging, a markdown link checker, and an AST-based code map generator.

Features

  • Custom Logging Handlers: Log messages to various destinations 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.
  • Markdown Link Checker: Scan markdown files for broken internal links — available as a library and a CLI tool.
  • Code Map Generator: Generate AST-based documentation artifacts (symbol index, dependency graph, entry points, call graph) for any Python package.

Installation

You can install the package via pip:

pip install bosos-dev-tools

Usage

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

Visualize the progress of long-running iterations in the console.

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.logger_settings import logger_setup

def main():
    logger_setup()

if __name__ == '__main__':
    main()

Log files are written to a structured folder hierarchy:

logs/
  2026/
    03/
      02/
        2026-03-02T062351.log

The folder path is controlled by environment variables:

Variable Default Description
LOGGER_PATH ./logs Base log directory
LOGGER_DAY_SPECIFIC False Add a day subfolder (zero-padded)
LOGGER_SCRIPT_FOLDERS False Add a script-name subfolder before the year
LOGGER_APPEND_SAME_DAY False Reuse one stable log file per folder instead of creating a new file each run
SCRIPT_NAME current working directory name Identifier used for script-specific folders and stable same-day basenames

Logging Configuration File

logger_setup() looks for an INI-style logging config file in the current working directory:

  • Normal mode: logging.conf (override with LOGGER_CONF_PATH)
  • Debug mode (DEBUG=True): logging_dev.conf (override with LOGGER_CONF_DEV_PATH)

If the config file is not found, a sensible built-in default is used automatically — no .conf file is required. The default configuration writes to both a file handler (all messages) and a console handler (warnings only; or all messages in debug mode).

If LOGGER_APPEND_SAME_DAY=True, logger_setup() uses a stable basename such as my_script.log inside the resolved log folder so repeated runs append to the same file for that folder. This works best with the built-in timed rotation or the included logging.conf files.

If you pass script_name directly to logger_setup(script_name="my_etl_script"), that value takes precedence for that call only. It does not overwrite the process SCRIPT_NAME environment variable for later logging setup calls.

Variable Default Description
LOGGER_CONF_PATH logging.conf Path to the logging config file
LOGGER_CONF_DEV_PATH logging_dev.conf Path to the debug logging config file
DEBUG False Enable debug mode (verbose console output)

Markdown Link Checker

Scan markdown files for broken internal links. Available as a library or a CLI tool.

As a library:

from dev_tools.md_link_checker import scan_all
from pathlib import Path

result = scan_all(Path("."))
for r in result.results:
    if r.status == "broken":
        print(f"{r.source_file}:{r.line_number} -> {r.target} ({r.reason})")

As a CLI:

# Installed console script
md-link-checker --verbose

# Or run as a module
python -m dev_tools.md_link_checker --no-anchors --json

Code Map Generator

Generate AST-based documentation for a Python package — symbol index, dependency graph, entry points, and call graph.

As a library:

from pathlib import Path
from dev_tools.codemap_generator import CodeMapGenerator

gen = CodeMapGenerator(src_root=Path("src"), package_name="my_package")
gen.analyze()
gen.write_outputs(output_dir=Path("docs"))

As a CLI:

# Installed console script
codemap-generator --package my_package

# Or run as a module
python -m dev_tools.codemap_generator --package my_package --output-dir docs

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-1.2.0.tar.gz (42.9 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-1.2.0-py3-none-any.whl (50.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bosos_dev_tools-1.2.0.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for bosos_dev_tools-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c1644aa37df36a4cd28445c07b4397fd159d98dc5b6911301d28cdb24d9d46c3
MD5 cba03bc49cdc7cd5351fcbebd20691b2
BLAKE2b-256 48ae983cbbc8ccda83712c42321c188af5b045384cd46a1dd41ac85c2c5d6f98

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for bosos_dev_tools-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88bcea589a4c21da3abc5256cd4fd2116f464c5bfd4050ec642e3f165004fa64
MD5 a5b38e24ae2baf721a2d6318a588a4e6
BLAKE2b-256 d089f1af89208d8420e941e6ce92f11184826f377c0034866a5377bc76251403

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