Live Python function execution tracer with timing and slow function detection
Project description
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
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pytrace_live-0.1.4.tar.gz.
File metadata
- Download URL: pytrace_live-0.1.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57d236df538318f23979dde2da2f0631d51bf5158efdcae5c60fdd292ae35507
|
|
| MD5 |
5cdbd92e7372b3d7b478f0eedbc4355e
|
|
| BLAKE2b-256 |
ddba2a17b392f295f9796f8afbda08bcf7e5624de3b5d7634ba7bb4fbb9ff0eb
|
File details
Details for the file pytrace_live-0.1.4-py3-none-any.whl.
File metadata
- Download URL: pytrace_live-0.1.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a62bec8339fef5a6c3d4045a4b0438e62c97c244f9cca4774e98372007a9f176
|
|
| MD5 |
2b40f63fad0cd830363e82e9b27198fa
|
|
| BLAKE2b-256 |
dfa04f687df1f28b2714080e75181e99abca096e25feaef6d7b8d4c76580e465
|