Metadata-Version: 2.1
Name: fastapi-pulse
Version: 0.2.0
Summary: Check your FastAPI's pulse with one line of code. Instant health monitoring and dashboard.
Author-email: Parham Davari <parham.davarii@gmail.com>
Project-URL: Homepage, https://github.com/parhamdavari/fastapi-pulse
Project-URL: Bug Tracker, https://github.com/parhamdavari/fastapi-pulse/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Framework :: FastAPI
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi
Requires-Dist: tdigest>=0.5.2
Requires-Dist: httpx>=0.23.0
Provides-Extra: cli
Requires-Dist: click>=8.1.0; extra == "cli"
Requires-Dist: rich>=13.0.0; extra == "cli"
Requires-Dist: pyyaml>=6.0.0; extra == "cli"
Provides-Extra: test
Requires-Dist: pytest>=7.0.0; extra == "test"
Requires-Dist: pytest-cov>=4.0.0; extra == "test"
Requires-Dist: pytest-asyncio>=0.18.0; extra == "test"
Requires-Dist: httpx>=0.23.0; extra == "test"
Requires-Dist: numpy>=1.20.0; extra == "test"
Provides-Extra: dev
Requires-Dist: uvicorn; extra == "dev"

# FastAPI Pulse

> Keep an eye on your FastAPI app with one joyful line.

[![PyPI](https://img.shields.io/pypi/v/fastapi-pulse.svg?color=2ca58d)](https://pypi.org/project/fastapi-pulse/)
[![Python](https://img.shields.io/pypi/pyversions/fastapi-pulse.svg?color=4c6ef5)](https://pypi.org/project/fastapi-pulse/)
[![CI](https://github.com/parhamdavari/fastapi-pulse/actions/workflows/ci.yml/badge.svg)](https://github.com/parhamdavari/fastapi-pulse/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-1c7ed6.svg)](./LICENSE)

FastAPI Pulse makes monitoring feel natural: drop in `add_pulse(app)` and you instantly get live dashboards, smart probes, and a CLI that plays nicely with CI/CD. No boilerplate. No config jungle. Just signal.

---

## Two-Breath Install

```bash
pip install fastapi-pulse
```

```python
from fastapi import FastAPI
from fastapi_pulse import add_pulse

app = FastAPI()
add_pulse(app)  # monitor, dashboard, probes – all unlocked
```

Want the CLI too? `pip install "fastapi-pulse[cli]"`

---

## Why People Love It

- **One-line setup** – call `add_pulse(app)` and ship it.
- **Peaceful defaults** – zero configuration for the common path.
- **Live dashboard** – `/pulse` shows latency, throughput, success rates.
- **Probing built-in** – discover endpoints and fire health checks from the UI or CLI.
- **Production-safe** – TDigest percentiles, rolling windows, no memory leaks.

---

## What You Get

| Experience                | Endpoint                          |
|--------------------------|----------------------------------|
| Friendly dashboard       | `GET /pulse`                     |
| Endpoint explorer        | `GET /pulse/endpoints.html`      |
| JSON metrics             | `GET /health/pulse`              |
| Probe registry           | `GET /health/pulse/endpoints`    |
| Trigger a probe          | `POST /health/pulse/probe`       |
| Check probe status       | `GET /health/pulse/probe/{id}`   |

Add your own monitors using the JSON API or wire it into your favorite alerting tool—the payload mirrors what the dashboard sees.

---

## Tiny Tweaks When You Need Them

```python
add_pulse(
    app,
    dashboard_path="/pulse",          # move the UI
    enable_detailed_logging=False,    # quiet production logs
    payload_config_path="pulse_probes.json",  # persist probe payloads
)
```

Prefer a custom metrics window?

```python
from fastapi_pulse import PulseMetrics

metrics = PulseMetrics(window_seconds=600)
add_pulse(app, metrics=metrics)
```

---

## CLI In Your Pocket

```bash
pulse-cli check http://localhost:8000
pulse-cli check https://api.example.com --fail-on-error --format json
```

📚 Dive deeper in [CLI_README.md](./CLI_README.md).

---

## Trying the TestPyPI Build

```bash
python3 -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install --index-url https://test.pypi.org/simple/ \
            --extra-index-url https://pypi.org/simple/ \
            fastapi-pulse==0.2.0
python -c "import fastapi_pulse; print(fastapi_pulse.__version__)"
```

FastAPI Pulse is intentionally light—keep the virtualenv clean, and you can flip between published builds in seconds.

---

## Contribute With Ease

Issues and pull requests are welcome. The guiding principle is the same as the product: simple, helpful, and kind to the next developer.

---

## License

MIT © [Parham Davari](./LICENSE)
