Skip to main content

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

pytrace_live-0.1.5.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

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

pytrace_live-0.1.5-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file pytrace_live-0.1.5.tar.gz.

File metadata

  • Download URL: pytrace_live-0.1.5.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for pytrace_live-0.1.5.tar.gz
Algorithm Hash digest
SHA256 e0c0ad3b3507398df27cf7a155a7b69c1f5f11c3174b90d52a7bb41b2d43e33b
MD5 5f0e7664fb814999372b378f80c2ca94
BLAKE2b-256 57362933198fc62cdd8c043dbfd16c2f79c97af56c2aa875feb86d7198224730

See more details on using hashes here.

File details

Details for the file pytrace_live-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pytrace_live-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for pytrace_live-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8fe60170b0b86a2bc59f299faa5f7587adefa99b616a4e1da1a898783123cedf
MD5 251fda4cd1281c5154ca5a55050c9120
BLAKE2b-256 2216f29db58daebe1a402788da176fd80d114270c3f51d8ccb978bbf039c756b

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