Skip to main content

FastAPI integration for eventiq

Project description

Tests Build License Mypy Ruff security: bandit Python Format PyPi

eventiq-fastapi

FastAPI integration for eventiq

Installation

pip install eventiq-fastapi

Usage

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")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eventiq_fastapi-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

eventiq_fastapi-0.1.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file eventiq_fastapi-0.1.0.tar.gz.

File metadata

  • Download URL: eventiq_fastapi-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.5

File hashes

Hashes for eventiq_fastapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 eb64129444afe139102e68c8ace1035d92b6115db614d8d50f640a0e253abcf3
MD5 6777a08984b4b1470d8d822fa804e6c2
BLAKE2b-256 1b78ed50ac07e7039c0de87d09fe64c0291174d0664b168ac5a66f812d9676cf

See more details on using hashes here.

File details

Details for the file eventiq_fastapi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for eventiq_fastapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c74ee8509a9d4bbb2a4de7b2b037f2b71f3c8493b1d61227b11cd2c6728a2c02
MD5 05f472cc416b218986bb5b8d1fd12886
BLAKE2b-256 6d51f3e8885ba79701a0264031c8fef93628d471284564b8ce55fbcb7e8cb519

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page