Skip to main content

A tool for running Python scripts line by line with error handling and reporting.

Project description

Tracor

🚀 Debug Python Scripts Faster

This utility script allows you to execute a Python script line by line, catch any errors that occur along the way, and provide essential debugging information with enhanced context. Additionally, it generates a well-formatted Markdown report highlighting the errors encountered during execution.

Features

  • Executes a Python script line by line.
  • Catches and logs errors with detailed context and colored output for better readability.
  • Generates a Markdown report summarizing the errors.
  • Allows customizable colors for different parts of the error messages.
  • Supports stopping execution on the first error or after a specified number of errors.
  • Includes options to show full tracebacks in the Markdown report.

Usage

Basic Usage

You can download tracor from PyPI:

pip install tracor

Then, you can run it with:

tracor path/to/your_script.py [options]

Usage With Flags

  • --stop-on-error: Stop execution on the first error.
  • --output-file <file>: Specify the output Markdown file for the error report.
  • --log-level <level>: Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL).
  • --max-errors <n>: Limit the number of errors to report before stopping execution.
  • --show-traceback: Include full traceback in the Markdown report.
  • --execution-color <color>: Color for executed lines (default: GREEN).
  • --error-color <color>: Color for error lines (default: RED).
  • --code-color <color>: Color for code in error messages (default: YELLOW).
  • --type-color <color>: Color for error type in error messages (default: CYAN).
  • --message-color <color>: Color for error message in error messages (default: MAGENTA).
  • --traceback-color <color>: Color for traceback in error messages (default: WHITE).

Example -

tracor example_script.py --output-file custom_error_report.md --log-level DEBUG --max-errors 5 --show-traceback --execution-color GREEN --error-color RED --code-color YELLOW --type-color CYAN --message-color MAGENTA --traceback-color WHITE

Output

Terminal Output

The terminal output will show the execution of each line and any errors encountered with enhanced multi-colored highlighting for better readability.

Markdown Report

A well-formatted Markdown report summarizing the errors will be generated. The report includes:

A summary section with the total number of errors. A detailed table with line numbers, code snippets, error types, error messages, and tracebacks.

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

tracor-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

tracor-0.1.2-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for tracor-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a7b6b757cf306fe4981f8b045f046fb2aa308f38cd6f014089d4fa416d6935da
MD5 63f270860cb984e737a9ebb7fe4afbc6
BLAKE2b-256 48501253970f51b629443e3cca8646f981b7550fcd33f17311426efc485bcab2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: tracor-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.9.19

File hashes

Hashes for tracor-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f807139ff9a2e1a694249cb35a43ff3dbb88c1e4860bea69eb3261c9536cf2f9
MD5 b8f39b9cc9a6588fe50e1c840465ba8f
BLAKE2b-256 6d1495cb7b616a00a292a9d67e5c94f16b9f629883177ee29bc8d8509ea4fde2

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