IPython magic for cProfile graphs w gprof2dot and graphviz in Jupyter/iterm.
Project description
profilegraph
A line/cell magic for displaying cProfile results in graph form. Like %time
or %%time, but
with far more information (with the performance penalty you'd expect from
cProfile.run).
Inspired by mattijn/gprof2dot_magic.
Install
This package requires Jupyter with a python kernel to be installed. The only
other python dependency is
gprof2dot, which is used to convert
cProfile output to a graphviz-compatible dotfile and is installed by pip
automatically, and a graphviz binary,
which is used to render the SVG output. You can install graphviz from the
provided download link or using the package manager of your choice.
pip install profilegraph
Use
Load the extension in a Jupyter notebook:
%load_ext profilegraph
Profile a line of code by sticking %profilegraph at the start:
import re
%profilegraph re.sub("biz", "baz", "foobarbiz")
If you have a whole cell that needs to be profiled, you can use the cell magic form:
%%profilegraph
for i in range(10):
print(i)
Develop
profilegraph uses flit. Install
flit with pip install flit.
Install in editable mode with:
flit install [--symlink] [--python path/to/python]
Upload to PyPI with:
flit publish
Project details
Release history Release notifications | RSS feed
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 profilegraph-0.2.0.tar.gz.
File metadata
- Download URL: profilegraph-0.2.0.tar.gz
- Upload date:
- Size: 174.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6df748cbcd93bc0fa8abe1cc805fa4adc5cb7b3dfd79f5607867c2ba62b23496
|
|
| MD5 |
18eb0ac43f08003bead4c5421d3c81c2
|
|
| BLAKE2b-256 |
12c5d8f225575c493b17d1b5c5c528a573e388e2b13e86018fe47e0ff6cf9ecc
|
File details
Details for the file profilegraph-0.2.0-py3-none-any.whl.
File metadata
- Download URL: profilegraph-0.2.0-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.24.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbf507e60e02a583d6154af4a5a1d2df177aa94e0fdf99fb69fa7e53e1ccf2a7
|
|
| MD5 |
ac14995ff2e6dadcabe98400447c9135
|
|
| BLAKE2b-256 |
e10efa7aed95e0bd98890d253f507f816135b18da9e804353d71d95d63aea15a
|