Skip to main content

pytrace-live

A lightweight Python CLI tool that traces function execution in real-time, showing execution times and highlighting slow functions as your code runs.

Installation

pip install pytrace-live

Usage

Basic usage:

pytrace-live script.py

With custom slow threshold (default is 100ms):

pytrace-live script.py --threshold 200

Example Output

→ load_config()              6 ms
→ connect_db()             420 ms  ⚠ SLOW
→ fetch_users()           1310 ms  🚨 VERY SLOW
→ process_data()            45 ms
→ save_results()           180 ms  ⚠ SLOW

Color coding:

  • Green: Normal execution (< threshold)
  • Yellow: Slow (≥ threshold) with ⚠ SLOW marker
  • Red: Very slow (≥ 5× threshold) with 🚨 VERY SLOW marker

Why Use This?

  • Zero code changes: Just run your script through pytrace-live
  • Live feedback: See performance bottlenecks as they happen
  • Minimal overhead: Uses Python's built-in profiling hooks
  • Clean output: Only shows your functions, filters out internal/stdlib calls

Perfect for quick performance checks during development without setting up complex profiling tools.

Requirements

  • Python 3.9 or higher
  • rich (for terminal formatting)

License

MIT License - see LICENSE file for details

Release files for pytrace-live 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytrace-live 1.0.0
File Size Uploaded
pytrace_live-1.0.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytrace-live 1.0.0
File Interpreter ABI Platform
pytrace_live-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / pytrace_live-1.0.0.tar.gz

Download URL pytrace_live-1.0.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
10ae30093cf017e78c0be5889de3a78fec1bf5fd005edfa9488f9a9ac4eb58fc
BLAKE2b-256 checksum
How to use checksums
4cd0c47b7dc2775f3ff4faff6e542a8669ab702ddaa72331913f3fed8a94b759
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Release files / pytrace_live-1.0.0-py3-none-any.whl

Download URL pytrace_live-1.0.0-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16fb893cf2fec77c9d27a005b57821ebf1d816022b35a990f0aedc42edbd7c98
BLAKE2b-256 checksum
How to use checksums
6c4525a0ebc872dd376760995befcfd5f71e9f3f6d5b873227136ff7cedaa256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.10

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page