Metadata-Version: 2.3
Name: wfork-streamlit-profiler
Version: 1.6.0
Summary: (fork of) Runtime profiler for Streamlit, powered by pyinstrument
License: MIT
Author: Wyatt S Carpenter
Requires-Python: >=3.8
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: dev
Requires-Dist: black (>=21.12b0,<22.0) ; extra == "dev"
Requires-Dist: pyinstrument (>=5.0.2,<5.1.0)
Requires-Dist: streamlit (>=1.0,<2.0)
Requires-Dist: typegun ; extra == "dev"
Requires-Dist: types-openpyxl ; extra == "dev"
Requires-Dist: types-python-dateutil ; extra == "dev"
Requires-Dist: typing-extensions (>=4.5)
Project-URL: Homepage, https://github.com/wyattscarpenter/streamlit-profiler
Description-Content-Type: text/markdown

# wfork-streamlit-profiler &nbsp;🏄🏼

[![PyPi](https://img.shields.io/pypi/v/wfork-streamlit-profiler)](https://pypi.org/project/wfork-streamlit-profiler/) [![GitHub latest tag](https://img.shields.io/github/v/tag/wyattscarpenter/streamlit-profiler?label=GitHub&logo=github)](https://github.com/wyattscarpenter/streamlit-profiler/)

**Runtime profiler for Streamlit, powered by [pyinstrument](https://github.com/joerick/pyinstrument).**

*wfork-streamlit-profiler is a fork of streamlit-profiler 0.2.4. If there are any newer versions of the original streamlit-profiler, you should probably use those instead. See the original project's github for more: https://github.com/jrieke/streamlit-profiler*

streamlit-profiler is a [Streamlit component](https://streamlit.io/components) that
helps you find out which parts of your app are slow. It profiles the code via
[pyinstrument](https://github.com/joerick/pyinstrument) and shows the results right
within your Streamlit app.

---

<h3 align="center">
  ⏱️ <a href="https://share.streamlit.io/jrieke/streamlit-profiler/main/examples/basic.py">Live demo</a> ⏱️
</h3>

---

<p align="center">
    <a href="https://share.streamlit.io/jrieke/streamlit-profiler/main/examples/basic.py"><img src="images/demo.png" width=600></a>
</p>

## Installation

```bash
pip install wfork-streamlit-profiler
```

## Usage

```python3
import streamlit as st
from wfork_streamlit_profiler import Profiler

with Profiler():
    st.title("My app")
    # ... other code
```

Or:
```python3
import streamlit as st
from wfork_streamlit_profiler import Profiler

p = Profiler()
p.start()
# ... other code
p.stop()
```

Then start your app as usual: `streamlit run my_app.py`

The `Profiler` class is an extension of `pyinstrument.Profiler`, so you can use
[all of its functions](https://pyinstrument.readthedocs.io/en/latest/reference.html#pyinstrument.Profiler).

Don't want the profiler to immediately display when you stop profiling? Initialize it with `Profiler(auto_output_on_stop=False)` instead, and call the `.output_streamlit()` method whenever you want it to display, instead. You can also set the async_mode of the profiler in the pyinstrument in the same constructor, whatever that means.

