Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asynq-io/eventiq-fastapi
FastAPI integration for eventiq
https://github.com/asynq-io/eventiq-fastapi
asyncio eventiq fastapi
Last synced: 5 days ago
JSON representation
FastAPI integration for eventiq
- Host: GitHub
- URL: https://github.com/asynq-io/eventiq-fastapi
- Owner: asynq-io
- License: apache-2.0
- Created: 2024-08-05T12:03:37.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-25T21:15:53.000Z (about 2 months ago)
- Last Synced: 2024-09-28T14:17:03.925Z (about 2 months ago)
- Topics: asyncio, eventiq, fastapi
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![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_lifespanservice = 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")
```