faststream
FastStream: the simplest way to work with a messaging queues
What it is and what it does
FastStream is a framework for building asynchronous, event-driven applications that consume and produce messages across multiple brokers. It provides a unified decorator-based interface that handles message parsing, serialization, and networking automatically. The framework integrates dependency injection, validation via Pydantic or Msgspec, and AsyncAPI documentation generation to reduce boilerplate while keeping underlying broker capabilities accessible.
Typical use cases include building streaming microservices, message queue consumers and producers, and data pipeline components. It supports Kafka, RabbitMQ, NATS, Redis, and MQTT out of the box with optional extras for each broker. The framework works with modern async Python (3.10+) and integrates with HTTP frameworks, making it suitable for hybrid synchronous-asynchronous architectures.
Use it for:
- Build microservices with minimal boilerplate using decorators and type annotations for message handling.
- Create real-time data pipelines that consume from one broker topic and publish to another with automatic validation.
- Generate AsyncAPI documentation automatically from your message handlers without manual schema definition.
- Test message-driven services in-memory without spinning up broker instances in your CI/CD pipeline.
- Integrate event-driven logic into applications using the built-in plugin support.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
An asynchronous Python framework for building event-driven applications with support for multiple message brokers and automatic AsyncAPI documentation generation.
Yes. FastStream is actively maintained, permissively licensed under Apache-2.0, has low install friction, and addresses a real need for simplified event-driven development across multiple brokers. It is production-stable with no known vulnerabilities. Install it if you are building message-driven microservices and want to reduce boilerplate.
Install
faststream on PyPI
pip
pip install faststreamuv
uv add faststreampoetry
poetry add faststreamInstalling faststream
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with a recent release 7 days ago and strong community engagement (5304 GitHub stars). Requires Python 3.10 or later.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions—suitable for most production and proprietary projects.
Quickstart
pip install 'faststream[kafka]'
from faststream import FastStream
from faststream.kafka import KafkaBroker
broker = KafkaBroker("localhost:9092")
app = FastStream(broker)
@broker.subscriber("in")
@broker.publisher("out")
async def handle_msg(user: str, user_id: int) -> str:
return f"User: {user_id} - {user} registered"
Requires a running message broker instance and Python 3.10 or later.
Verify before relying
- Performance characteristics and throughput limits under production load.
- Compatibility matrix details with specific broker versions.
- Overhead of the dependency injection and validation layers compared to raw broker clients.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — fast-depends, typing-extensions, anyio |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,431,199/month — #3,913 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: faststream-0.7.4-py3-none-any.whl
Keywords: rabbitmq, kafka, nats, redis, mqtt, asyncapi, framework, message brokers
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
broadcasterBroadcaster provides a simple async broadcast…
permissive · top 15,000 on PyPI
quixstreamsQuix Streams is a Python framework for building…
permissive · top 15,000 on PyPI
kafkaA pure-Python client library for Apache Kafka…
permissive · top 15,000 on PyPI
taskiqTaskiq is an asynchronous distributed task…
permissive · top 5,000 on PyPI
nats-pyAn asyncio Python client for connecting to and…
permissive · top 5,000 on PyPI
faust-streamingFaust-streaming is a Python library for…
permissive · top 15,000 on PyPI
namekoNameko is a microservices framework for Python…
permissive · top 15,000 on PyPI
taskiq-redisAdds Redis-based message brokers and result…
permissive · top 5,000 on PyPI
kafka-python-ngA Python client library for Apache Kafka that…
permissive · top 5,000 on PyPI
port-oceanPort Ocean is a CLI framework and runtime for…
permissive · top 15,000 on PyPI