Metadata-Version: 2.3
Name: github-events
Version: 0.1.0
Summary: TypedDicts for every GitHub webhook event, with optional pydantic validation and FastAPI dispatch
Requires-Dist: typing-extensions>=4.12
Requires-Dist: fastapi>=0.110 ; extra == 'fastapi'
Requires-Dist: pydantic>=2.0 ; extra == 'fastapi'
Requires-Dist: pydantic>=2.0 ; extra == 'pydantic'
Requires-Python: >=3.11
Provides-Extra: fastapi
Provides-Extra: pydantic
Description-Content-Type: text/markdown

# github-events

Typed GitHub webhook payloads, HMAC signature verification, and event dispatch.

```sh
pip install github-events
# Optional payload validation and FastAPI integration:
pip install 'github-events[fastapi]'
```

```python
import os
from github_events import WebhookDispatcher

hooks = WebhookDispatcher(secret=os.environ["GITHUB_WEBHOOK_SECRET"])

@hooks.on("push")
async def on_push(payload):
    print(payload["ref"])
```

Pass the raw request body and GitHub webhook headers to the dispatcher, or mount
its `as_fastapi_router()` in your FastAPI application. The base package depends only on `typing-extensions`. The `pydantic` extra adds validation; the `fastapi` extra
adds the HTTP integration and validation dependencies.
