skillfed

faststream

FastStream: the simplest way to work with a messaging queues

faststream v0.7.4 1.4M downloads/30d#3,913 on PyPI5,304
Permissive license Apache-2.0 Active released

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 faststream

uv

uv add faststream

poetry

poetry add faststream

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: AsyncIOFramework :: PydanticFramework :: Pydantic :: 1Framework :: Pydantic :: 2Intended Audience :: DevelopersIntended Audience :: Information TechnologyIntended Audience :: System AdministratorsLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Application FrameworksTopic :: Software Development :: Libraries :: Python ModulesTopic :: System :: Distributed ComputingTopic :: System :: NetworkingTyping :: Typed

Tags

message broker frameworkevent-driven microservicesasync message queueasyncapi documentationstreaming data processingevent consumer producerkafka rabbitmq nats redis mqtt
async-frameworkmessage-brokersmicroservices

More Software Development packages