Metadata-Version: 2.4
Name: yapflame
Version: 0.1.2
Summary: Simple yappi flamegraphs
Project-URL: Homepage, https://github.com/bekerk/yapflame
Project-URL: Issues, https://github.com/bekerk/yapflame/issues
Project-URL: Releases, https://github.com/bekerk/yapflame/releases
Project-URL: Repository, https://github.com/bekerk/yapflame
Author: bekerk
License-Expression: MIT
License-File: LICENSE
Keywords: flamegraph,profiler,profiling,yappi
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: yappi>=1.6
Description-Content-Type: text/markdown

# yapflame

<p align="center">
    <a href="https://github.com/bekerk/yapflame/actions/workflows/ci.yml"><img src="https://github.com/bekerk/yapflame/actions/workflows/ci.yml/badge.svg?branch=main"></a>
    <a href="https://pypi.org/project/yapflame/"><img src="https://img.shields.io/pypi/v/yapflame.svg"></a>
    <a href="https://pypi.org/project/yapflame/"><img src="https://img.shields.io/pypi/dw/yapflame.svg"></a>
    <a href="https://pypi.org/project/yapflame/"><img src="https://img.shields.io/pypi/pyversions/yapflame.svg"></a>
    <a href="https://github.com/bekerk/yapflame/commits/"><img src="https://img.shields.io/github/last-commit/bekerk/yapflame.svg"></a>
    <a href="https://github.com/bekerk/yapflame/blob/main/LICENSE"><img src="https://img.shields.io/github/license/bekerk/yapflame.svg"></a>
</p>

Simple [yappi](https://github.com/sumerc/yappi) flamegraphs.

<p align="center">
    <img src="https://raw.githubusercontent.com/bekerk/yapflame/refs/heads/main/assets/yapflame.png" />
</p>

## Installation

```bash
pip install yapflame
uv add yapflame
# and others...
```

## Examples

```python
from yapflame import profile

with profile() as p:
    do_work()

p.open()       # browser
p.save("o.html")  # file
```

`enabled=False` to noop:

```python
with profile(enabled=DEBUG) as p:
    do_work()
if p:
    p.open()
```

or via cli:
```bash
yapflame script.py
yapflame script.py -o out.html
yapflame script.py --cpu
```
