Skip to content

Commit 899db9a

Browse files
Berik AshimovBerik Ashimov
authored andcommitted
docs: add Official plugins page and ecosystem section
1 parent 961370f commit 899db9a

5 files changed

Lines changed: 111 additions & 1 deletion

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,28 @@ Using `style=for-the-badge` instead of `flat` gives a larger, more prominent var
11961196

11971197
---
11981198

1199+
## Official plugins
1200+
1201+
The core stays small; everything else lives in optional `hawkapi-*` packages on PyPI. Each follows the same `init_xxx(app, ...)` + `Depends(get_xxx)` pattern.
1202+
1203+
| Package | Purpose |
1204+
| --- | --- |
1205+
| [`hawkapi-sentry`](https://pypi.org/project/hawkapi-sentry/) | Sentry SDK — exceptions, traces, request context |
1206+
| [`hawkapi-otel`](https://pypi.org/project/hawkapi-otel/) | OpenTelemetry — traces, metrics, logs |
1207+
| [`hawkapi-auth`](https://pypi.org/project/hawkapi-auth/) | JWT (access + refresh), argon2id passwords, DI guards |
1208+
| [`hawkapi-sqlalchemy`](https://pypi.org/project/hawkapi-sqlalchemy/) | Async SQLAlchemy 2.0, multi-DB routing, Alembic helper, fixtures |
1209+
| [`hawkapi-cache`](https://pypi.org/project/hawkapi-cache/) | Response caching with TTL + tag invalidation; in-memory + Redis |
1210+
| [`hawkapi-storage`](https://pypi.org/project/hawkapi-storage/) | Local / S3 / GCS / Azure with streaming + pre-signed URLs |
1211+
| [`hawkapi-mail`](https://pypi.org/project/hawkapi-mail/) | SMTP / SES / SendGrid / Mailgun / Resend, templates, outbox, webhooks |
1212+
| [`hawkapi-celery`](https://pypi.org/project/hawkapi-celery/) | Celery — async tasks, beat, context propagation, healthchecks |
1213+
| [`hawkapi-websockets`](https://pypi.org/project/hawkapi-websockets/) | Connection manager, rooms, Redis pub/sub backplane, heartbeat |
1214+
| [`hawkapi-mcp`](https://pypi.org/project/hawkapi-mcp/) | Model Context Protocol — expose routes as MCP tools for LLM agents |
1215+
| [`hawkapi-admin`](https://pypi.org/project/hawkapi-admin/) | Auto-generated CRUD admin UI for hawkapi-sqlalchemy models |
1216+
1217+
See [docs/guide/plugins.md](docs/guide/plugins.md) for the full reference and the upcoming-plugin roadmap.
1218+
1219+
---
1220+
11991221
## License
12001222

12011223
MIT License. See [LICENSE](LICENSE) for details.

docs/guide/plugins.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Official plugins
2+
3+
HawkAPI ships a small, focused core. Everything else — auth, mail, cache, file storage, an admin UI — lives in optional packages under the `hawkapi-*` namespace. Install only what you need; every plugin follows the same `init_xxx(app, ...)` + `Depends(get_xxx)` pattern.
4+
5+
## Observability
6+
7+
| Package | Install | Purpose |
8+
| --- | --- | --- |
9+
| [`hawkapi-sentry`](https://pypi.org/project/hawkapi-sentry/) | `pip install hawkapi-sentry` | Sentry SDK integration — exceptions, traces, request context |
10+
| [`hawkapi-otel`](https://pypi.org/project/hawkapi-otel/) | `pip install hawkapi-otel` | OpenTelemetry — auto-instrumentation, traces, metrics, logs |
11+
12+
## Auth & security
13+
14+
| Package | Install | Purpose |
15+
| --- | --- | --- |
16+
| [`hawkapi-auth`](https://pypi.org/project/hawkapi-auth/) | `pip install hawkapi-auth` | JWT (access + refresh), argon2id passwords, DI guards, scopes |
17+
18+
## Data layer
19+
20+
| Package | Install | Purpose |
21+
| --- | --- | --- |
22+
| [`hawkapi-sqlalchemy`](https://pypi.org/project/hawkapi-sqlalchemy/) | `pip install hawkapi-sqlalchemy` | Async SQLAlchemy 2.0 — sessions in DI, multi-DB routing (primary/replica/shards), `Base`/`TimestampMixin`/`UUIDMixin`, Alembic helper, pytest fixtures |
23+
| [`hawkapi-cache`](https://pypi.org/project/hawkapi-cache/) | `pip install hawkapi-cache` | Response caching with TTL + tag-based invalidation; in-memory and Redis backends |
24+
| [`hawkapi-storage`](https://pypi.org/project/hawkapi-storage/) | `pip install hawkapi-storage` | Pluggable file storage — local, S3 (incl. MinIO/R2/Wasabi), GCS, Azure; streaming + pre-signed URLs |
25+
26+
## Messaging & integration
27+
28+
| Package | Install | Purpose |
29+
| --- | --- | --- |
30+
| [`hawkapi-mail`](https://pypi.org/project/hawkapi-mail/) | `pip install hawkapi-mail` | Email backends (SMTP, SES, SendGrid, Mailgun, Resend), Jinja2 templates, persistent outbox + retry, webhook handlers for bounce/complaint events |
31+
| [`hawkapi-celery`](https://pypi.org/project/hawkapi-celery/) | `pip install hawkapi-celery` | Celery integration — `@task` decorator (async-aware), beat schedule helpers, broker/worker healthchecks, request-context propagation, eager-mode fixtures |
32+
| [`hawkapi-websockets`](https://pypi.org/project/hawkapi-websockets/) | `pip install hawkapi-websockets` | Connection manager with rooms + broadcasting; optional Redis pub/sub backplane for multi-process fan-out; heartbeat monitor |
33+
| [`hawkapi-mcp`](https://pypi.org/project/hawkapi-mcp/) | `pip install hawkapi-mcp` | Model Context Protocol server — expose your routes as MCP tools to LLM agents |
34+
35+
## Admin
36+
37+
| Package | Install | Purpose |
38+
| --- | --- | --- |
39+
| [`hawkapi-admin`](https://pypi.org/project/hawkapi-admin/) | `pip install hawkapi-admin` | Auto-generated CRUD admin UI for hawkapi-sqlalchemy models — list, detail, create, edit, delete; type-driven widgets; search; pagination; light/dark CSS |
40+
41+
## A taste of the patterns
42+
43+
Every plugin follows the same shape — register at app startup, inject in handlers:
44+
45+
```python
46+
from hawkapi import Depends, HawkAPI
47+
from hawkapi_auth import init_auth, JWTConfig, random_secret, requires_user
48+
from hawkapi_sqlalchemy import init_database, get_session
49+
from hawkapi_cache import init_cache, cached
50+
from hawkapi_storage import LocalConfig, LocalStorage, init_storage, get_storage
51+
52+
app = HawkAPI()
53+
init_auth(app, config=JWTConfig(secret=random_secret()))
54+
init_database(app, url="postgresql+asyncpg://...")
55+
init_cache(app)
56+
init_storage(app, storage=LocalStorage(LocalConfig(root="/var/data")))
57+
58+
59+
@app.get("/me")
60+
@cached(ttl=60)
61+
async def me(user_id: str = Depends(requires_user)):
62+
...
63+
```
64+
65+
## Roadmap (not yet shipped)
66+
67+
Candidate plugins that fit the same pattern but haven't been built yet. Open an issue if one would unblock you:
68+
69+
- **hawkapi-ratelimit** — token bucket + sliding window with Redis
70+
- **hawkapi-cron** — in-process scheduler without a Celery dependency
71+
- **hawkapi-pagination** — cursor + offset helpers, `Page[T]` response model
72+
- **hawkapi-csrf** — CSRF for form-based flows (pairs with `hawkapi-admin`)
73+
- **hawkapi-i18n** — gettext + `Accept-Language` + lazy strings
74+
- **hawkapi-sse** — Server-Sent Events
75+
- **hawkapi-redis** / **hawkapi-mongo** / **hawkapi-clickhouse** / **hawkapi-kafka** / **hawkapi-search** — generic clients with DI + healthchecks
76+
- **hawkapi-webhook** — outbound webhooks with retry + HMAC signing
77+
- **hawkapi-events** — outbox pattern + domain event bus
78+
- **hawkapi-cli** — manage.py-style CLI (migrate, shell, run-jobs)
79+
- **hawkapi-payments** — Stripe + PayPal wrappers

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,11 @@ pip install "hawkapi[all]" # pydantic + granian + uvloop + uvicorn + ote
4848
pip install "hawkapi[otel]" # OpenTelemetry tracing
4949
pip install "hawkapi[pydantic]" # Pydantic model support
5050
```
51+
52+
## Ecosystem
53+
54+
The core stays small. Everything else — auth, SQLAlchemy sessions, response caching, file storage, email, Celery, WebSockets, an admin UI — lives in optional `hawkapi-*` packages on PyPI. See **[Official plugins](guide/plugins.md)** for the full list.
55+
56+
```bash
57+
pip install hawkapi-auth hawkapi-sqlalchemy hawkapi-cache hawkapi-admin
58+
```

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ nav:
5858
- Free-threaded Python (PEP 703): guide/free-threaded.md
5959
- Migration from FastAPI: guide/migration-from-fastapi.md
6060
- Doctor: guide/doctor.md
61+
- Official plugins: guide/plugins.md
6162
- API Reference: api/index.md
6263

6364
markdown_extensions:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)