A web interface for line-profiler
Project description
line-profiler-web
A web interface for line-profiler results.
Introduction
This is a web app for visualizing profiling results from Python's line-profiler. You can
- generate profiling results with
line-profiler - view profiling results of different runs
- view a summary table of function execution times
Install
You can install it via pip from PyPI:
pip install line-profiler-web
Usage
The app serves a directory of profiling results, by default profile/ in the current working directory.
To start the app, run:
python -m line_profiler_web --port 8080 --profile-path profile
Open the page in your browser: http://127.0.0.1:8080/
Then you can use line-profiler to profile your code (see for example example.py):
def main():
# your code here
pass
def slow_subfunction():
# your code here
pass
if __name__ == "__main__":
profile = True
if profile:
from line_profiler import LineProfiler
from line_profiler_web import save_stats
profile_dir = "profile"
lp = LineProfiler()
lp.add_function(main)
lp.add_function(slow_subfunction)
lp.run("main()")
save_stats(lp, profile_dir)
else:
main()
Run your script:
python example.py
Open the web page to view results. You can run your script multiple times (e.g. after code changes), each profile will be saved into a new file in the profile directory and all profile files are shown on the web page.
License
MIT
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 line_profiler_web-1.0.0.tar.gz.
File metadata
- Download URL: line_profiler_web-1.0.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
892ab89ffb3406196470a456cecff7ed534f205a5f992147fef69ffc6009c9dd
|
|
| MD5 |
be069a0781dabe837d2f7f0d3cf86f01
|
|
| BLAKE2b-256 |
190df42b00860c1622abf6a10ae04af48e5a4b1e952ce1bed0cf3bb9e3e9a854
|
File details
Details for the file line_profiler_web-1.0.0-py3-none-any.whl.
File metadata
- Download URL: line_profiler_web-1.0.0-py3-none-any.whl
- Upload date:
- Size: 15.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29a42417c0bf061f366e2e420eadcc65aeccf96dc6ef8aa740f3372ac6b321f0
|
|
| MD5 |
107bd6d910c749b9903ccaaa3591e3d9
|
|
| BLAKE2b-256 |
b3b3af7bf770f7d2646e55913444e69ab2bd9f1b4d784af4a23ff88a57d2ec92
|