rtprofile - Real-Time Profiling for Python
Real-time profiling tools designed for debugging running Python applications where traditional debugging is challenging.
Features
- Function Profiler: Thread-aware function profiling with console-inspectable stacks for all profiled frames
- Memory Profiler: Snapshot-based memory profiling with heap analysis (requires guppy3)
- Qt Event Profiler: Qt event loop profiling for PyQt/PySide applications
Requirements
- Python 3.12+
- PyQtGraph (optional, for Qt GUI widgets)
- Guppy3 (optional, for memory profiling)
Installation
pip install rtprofile
# With memory profiling support
pip install rtprofile[memory]
Usage
Headless Profiling (no Qt required)
from rtprofile.profiler import Profile
# Start profiling
prof = Profile()
prof.start()
# Your code here
...
# Stop and analyze
prof.stop()
prof.print_call_tree()
# Or analyze programmatically
from rtprofile.profiler import ProfileAnalyzer
analyzer = ProfileAnalyzer(prof)
function_lookup = analyzer.build_function_lookup()
Qt Profiler Widgets
from PyQt5.QtWidgets import QApplication
from rtprofile.function_profiler import FunctionProfiler
from rtprofile.memory_profiler import MemoryProfiler
from rtprofile.qt_profiler import QtEventProfiler
from rtprofile.profiler_tabs import ProfilerTabs
from rtprofile.code_editor import set_code_editor
app = QApplication([])
# Configure code editor for source navigation
set_code_editor('vscode') # or 'pycharm', 'sublime'
# Create and show function profiler widget
function_profiler = FunctionProfiler(parent_widget=None)
function_profiler.widget.show()
# Or use the combined tabbed widget
profiler_tabs = ProfilerTabs()
profiler_tabs.show()
app.exec()
Embedding Widgets
The profiler widgets can be embedded into existing applications:
from rtprofile.function_profiler import FunctionProfiler
# Embed in your existing window
profiler = FunctionProfiler(parent=my_window)
my_layout.addWidget(profiler.widget)
Code Editor Integration
Configure which code editor opens when double-clicking call locations:
from rtprofile.code_editor import set_code_editor
# Use a specific editor
set_code_editor('vscode') # or 'pycharm', 'sublime'
# Or provide a custom command template
set_code_editor('myeditor "{fileName}" --line {lineNum}')
License
MIT
Metadata
Release files for rtprofile 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rtprofile-1.0.2.tar.gz | 26.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rtprofile-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.2 kB
Release files / rtprofile-1.0.2.tar.gz
| Download URL | rtprofile-1.0.2.tar.gz |
|---|---|
| Size | 26.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a7db3d8ae39ab44bc13941683cd53e0ff8abda971cd32b2b778ba3e795611f9
|
|
BLAKE2b-256 checksum How to use checksums |
0f9ed87b032b179d1705e380f54ddd0d88a0b4f12a855cf8678d91ed3a4febb2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 4, 2026.
Transparency logRelease files / rtprofile-1.0.2-py3-none-any.whl
| Download URL | rtprofile-1.0.2-py3-none-any.whl |
|---|---|
| Size | 28.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
388d508c872518bce41d68efdaa367d598c1b9db442f5dbc86f21f01018378e1
|
|
BLAKE2b-256 checksum How to use checksums |
c844994779330a76590a31b0a273dd5d3d75f7f36100ac6e4ab0a2ccb1b8f3e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 4, 2026.
Transparency log