Metadata-Version: 2.4
Name: ravn-sdk
Version: 0.2.0
Summary: Error monitoring for Python without the Sentry tax — 100k events free, AI root cause analysis included
License-Expression: MIT
Project-URL: Homepage, https://getravn.com
Project-URL: Documentation, https://docs.getravn.com
Project-URL: Repository, https://github.com/Kosevskey/ravn-python
Project-URL: Bug Tracker, https://github.com/Kosevskey/ravn-python/issues
Keywords: monitoring,error-tracking,observability,logging,apm,sentry-alternative,error-monitoring,exception-tracking
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: System :: Logging
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28
Provides-Extra: django
Requires-Dist: django>=3.2; extra == "django"
Provides-Extra: flask
Requires-Dist: flask>=2.3; extra == "flask"
Provides-Extra: fastapi
Requires-Dist: starlette>=0.27; extra == "fastapi"
Dynamic: license-file

# ravn-sdk

[![PyPI version](https://img.shields.io/pypi/v/ravn-sdk)](https://pypi.org/project/ravn-sdk/)
[![Python versions](https://img.shields.io/pypi/pyversions/ravn-sdk)](https://pypi.org/project/ravn-sdk/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](LICENSE)

**Error monitoring for Python — without the Sentry tax.**  
100,000 events/month free. AI-powered root cause analysis included. Setup in 30 seconds.

→ [getravn.com](https://getravn.com) · [Dashboard](https://app.getravn.com) · [Docs](https://docs.getravn.com)

---

## Install

```bash
pip install ravn-sdk
```

## Setup

```python
import ravn

ravn.init(api_key="your_api_key_here")
```

That's it. Every unhandled exception that crashes the process — scripts, Celery tasks, background workers — is now captured automatically.

**Using Django, Flask, or FastAPI?** These frameworks catch request-handling exceptions themselves to render an error response, so they never reach the point `ravn.init()` hooks into. Add one line for your framework:

```python
# Django — in AppConfig.ready() or wsgi.py/asgi.py
from ravn.integrations.django import install
install()
```

```python
# Flask
from ravn.integrations.flask import init_app
init_app(app)
```

```python
# FastAPI / Starlette
from ravn.integrations.fastapi import RavnMiddleware
app.add_middleware(RavnMiddleware)
```

Get your API key at [app.getravn.com/register](https://app.getravn.com/register) — free, no credit card required.

---

## Features

### Automatic exception capture

After `ravn.init()`, all unhandled exceptions are captured automatically.

### Manual capture

```python
try:
    risky_operation()
except Exception as e:
    ravn.capture_exception(e, metadata={"user_id": 42})
```

### Log messages

```python
ravn.capture_message("Payment processed", level="info", metadata={"amount": 99.99})
```

Supported levels: `info`, `warning`, `error`.

### Performance monitoring

```python
@ravn.measure
def slow_database_query():
    ...
```

Functions decorated with `@ravn.measure` send a `warning` event if they exceed `slow_threshold_ms` (default: 1000ms).

---

## Configuration

```python
ravn.init(
    api_key="your_api_key_here",
    slow_threshold_ms=500,  # warn if functions take longer than 500ms
)
```

---

## Pricing

| Plan | Events/month | Price |
|---|---|---|
| Free | 100,000 | $0 — forever |
| Solo | 1,000,000 | $9.99/mo |
| Team | 10,000,000 | $19.99/mo |
| Business | 100,000,000 | $49.99/mo |

All paid plans include AI root cause analysis, Slack/Discord alerts, and performance monitoring.  
Full pricing at [getravn.com/pricing](https://getravn.com/pricing).

---

## Requirements

- Python ≥ 3.8
- `requests ≥ 2.28`

## License

MIT
