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
Metadata
Release files for line-profiler-web 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| line_profiler_web-1.0.0.tar.gz | 13.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| line_profiler_web-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 29.6 kB
Release files / line_profiler_web-1.0.0.tar.gz
| Download URL | line_profiler_web-1.0.0.tar.gz |
|---|---|
| Size | 13.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
892ab89ffb3406196470a456cecff7ed534f205a5f992147fef69ffc6009c9dd
|
|
BLAKE2b-256 checksum How to use checksums |
190df42b00860c1622abf6a10ae04af48e5a4b1e952ce1bed0cf3bb9e3e9a854
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / line_profiler_web-1.0.0-py3-none-any.whl
| Download URL | line_profiler_web-1.0.0-py3-none-any.whl |
|---|---|
| Size | 15.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29a42417c0bf061f366e2e420eadcc65aeccf96dc6ef8aa740f3372ac6b321f0
|
|
BLAKE2b-256 checksum How to use checksums |
b3b3af7bf770f7d2646e55913444e69ab2bd9f1b4d784af4a23ff88a57d2ec92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|