Skip to main content

A zero-configuration execution recorder for Python

Project description

blackboxpy

A zero‑configuration execution recorder for Python.

Know what your code actually did , even when it fails silently.

PyPI version Python 3.9+ Zero Dependencies License: MIT


Problem

Python code can fail silently:

  • exceptions are swallowed (try/except: pass)
  • functions return None unexpectedly
  • control flow diverges from what you expected

Logs and debuggers only help if you already know where to look.

blackboxpy answers a different question:

After my program ran, what actually happened?

Not guesses. Not logs you forgot to add. Actual execution evidence.


Quick Start

Install

pip install blackboxpy

Use (3 lines)

import blackboxpy

blackboxpy.start()
# ... your code runs here ...
blackboxpy.stop()
blackboxpy.report()

Output

Execution Summary
----------------------------------------------------------------------
process_data         | called 3x | avg 12.3ms | 1 exception(s)
validate_input       | called 6x | avg 0.1ms  | ok
transform_payload    | called 5x | avg 0.4ms  | returned None 1x

Exceptions
----------------------------------------------------------------------
process_data → ValueError('invalid format')

No configuration. No code changes. Just evidence.


What It Is (and Is Not)

It IS It is NOT
A passive execution recorder A debugger
Zero‑configuration A profiler
Post‑mortem friendly An observability platform
Lightweight and local An AI tool
Zero dependencies (stdlib only) Distributed tracing system

Think flight recorder, not live cockpit controls.

Note: Only uses Python standard library. No external packages required.


Features

v0.1: Core

  • Records function calls, timing, exceptions, returns
  • Captures swallowed exceptions
  • Human‑readable summary report
  • Save reports to file (with append mode)

v0.2: Insight

  • Chronological execution timeline
  • Shallow argument capture
  • Shallow return value capture
  • JSON export

v0.3: Control

  • CLI: blackboxpy run script.py
  • Module include/exclude filters
  • configure() API

v0.4: Scale

  • Async/await support
  • Sampling mode (trace a fraction of calls)
  • Automatic disk persistence

All versions are backward‑compatible.


API Reference

For complete and detailed API documentation (including all function signatures, parameters, examples, classes, CLI options, use cases, and troubleshooting), see:

📖 Full API Documentation

Quick links:


Intended Users

  • Backend developers
  • Script authors
  • Data engineers
  • Anyone debugging code without perfect logs

Not designed for high‑traffic production systems (yet).


Non‑Goals

  • Replacing debuggers
  • Replacing logging
  • Real‑time visualization
  • Distributed tracing

Project Info


blackboxpy records what your Python code actually did , especially when it failed quietly , without requiring you to prepare for failure in advance.

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

blackbox_recorder-0.4.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

blackbox_recorder-0.4.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file blackbox_recorder-0.4.0.tar.gz.

File metadata

  • Download URL: blackbox_recorder-0.4.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for blackbox_recorder-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2f683683ef3089fb9d12c0c20e1ad1173dd1bae9f7b583ebe2898213e5644a98
MD5 26030394e1add51008c52328a8f0aebe
BLAKE2b-256 14a7bc1a1e043d1fad5d54c19d47896f4c090875dff5e1b6ad6c6400a26a0f4c

See more details on using hashes here.

File details

Details for the file blackbox_recorder-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for blackbox_recorder-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 463f6fc6ae71f51f1459fa03eef15b1e4ca4a89dc2202144c28ddf22c478a943
MD5 ba13c5a435c4717f3b2bf775a34108ad
BLAKE2b-256 0f24a01473b136f7d1143a3dda5a7a118f6f4b3d49af8ed1a0a8b9a8ec5a14b5

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