Metadata-Version: 2.3
Name: eventiq-fastapi
Version: 0.0.1
Summary: FastAPI integration for eventiq
Project-URL: Documentation, https://github.com/asynq-io/eventiq-fastapi#readme
Project-URL: Issues, https://github.com/asynq-io/eventiq-fastapi/issues
Project-URL: Source, https://github.com/asynq-io/eventiq-fastapi
Author-email: RaRhAeu <rarha_eu@protonmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: eventiq,fastapi
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python
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: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.9
Requires-Dist: eventiq==0.3.0rc1
Requires-Dist: fastapi
Description-Content-Type: text/markdown

![Tests](https://github.com/asynq-io/eventiq-fastapi/workflows/Tests/badge.svg)
![Build](https://github.com/asynq-io/eventiq-fastapi/workflows/Publish/badge.svg)
![License](https://img.shields.io/github/license/asynq-io/eventiq-fastapi)
![Mypy](https://img.shields.io/badge/mypy-checked-blue)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json)](https://github.com/charliermarsh/ruff)
[![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
![Python](https://img.shields.io/pypi/pyversions/eventiq-fastapi)
![Format](https://img.shields.io/pypi/format/eventiq-fastapi)
![PyPi](https://img.shields.io/pypi/v/eventiq-fastapi)

# eventiq-fastapi

FastAPI integration for eventiq


## Installation

```shell
pip install eventiq-fastapi
```

## Usage

```python
from fastapi import FastAPI
from eventiq import Service, CloudEvent
from eventiq_fastapi import ServiceDependency, get_service_lifespan


service = Service(...)
app = FastAPI(lifespan=get_service_lifespan(service))

# possibly in dirrerent file/router, service will be injected
@app.post("/send-email")
async def send_mail(service: ServiceDependency):
    await service.send({"some": "data"}, topic="commands.send-email")
```
