- ✨ Features
- 🚀 Installation
- 🕹️ Quick start
- 📂 Project layout
- 🛣️ Road-map
- 👩💻 Contributing
- ⚖️ License
- 🙏 Acknowledgements
| 🔍 What you see | 💡 Captured via | 📈 Visualised as (Streamlit) |
|---|---|---|
| Byte-code timeline | sys.settrace |
Cumulative line graph |
| Heap usage (kB) | tracemalloc snapshots |
Live line graph |
| Sys-calls (Linux) | strace -c -p … |
Cumulative line graph |
| Smart commentary | 1 s heuristics | Green console panel |
macOS & Linux fully supported.
Windows → byte-code + memory tracing (no strace).
# stable
pip install pyxtrace
# pre-release / nightly
pip install --pre pyxtracepip install pyxtrace # includes the Streamlit dashboard
pip install "pyxtrace[dev]" # black, ruff, mypy, pytest, …Linux users – syscall tracing needs
straceand root:sudo apt install strace sudo pyxtrace --dash your_script.pyor skip sys-calls with
--no-syscalls.
# Rich CLI summary only
pyxtrace examples/fibonacci.py
# Live dashboard (opens http://127.0.0.1:8050)
pyxtrace --dash examples/fibonacci.py
# Pass cmd-line args to your script
pyxtrace --dash train.py -- --epochs 10 --lr 3e-4
# Performance presets
pyxtrace --mode demo script.py # call/return only (fastest)
pyxtrace --mode perf script.py # skip std-lib lines
pyxtrace --mode full script.py # trace everything (slowest)When the dashboard opens, press ▶ Start to begin streaming events in real-time. A speed slider lets you throttle or accelerate the playback (10 – 500 events / s).
src/pyxtrace/
├─ cli.py ← Typer CLI entry-point
├─ core.py ← orchestration + JSONL replay
├─ bytecode.py ← byte-code tracer
├─ memory.py ← heap sampler (tracemalloc)
├─ syscalls/ ← syscall tracer (Linux / Darwin stubs)
├─ visual.py ← Rich summary + Streamlit dashboard
└─ …
| Status | Item |
|---|---|
| 🔄 | Flame-graph view (Chrome-style) |
| 🔄 | CPU sample profiler (perf hook) |
| 🔄 | Remote dashboard via websockets |
| 🔄 | VS Code extension |
| ✅ | Streamlit dashboard |
git clone https://github.com/AbhineetSaha/pyxtrace.git
cd pyxtrace
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install- Create a feature branch from main
- Run
./dev_check.pyto execute the test suite and linters - Open a pull-request ❤️
Released under the MIT License – see LICENSE.
| Project / Lib | Why it’s awesome |
|---|---|
| Rich & Typer | Beautiful CLIs with zero boiler-plate |
| Streamlit & Plotly | Interactive dashboards in pure Python |
| tracemalloc | Built-in heap sampler, criminally underrated |
| strace | Decades-old yet still magical |
…and you – for trying, starring ⭐ and contributing!
