Faust is a Python library for stream and event processing over Kafka, inspired by Kafka Streams. You write async agents and tables in plain Python without a separate DSL.
Overview
Faust ports Kafka Streams-style processing to Python using asyncio and type annotations. Workers consume partitioned Kafka topics through agents—async functions that handle each event—and can call other Python libraries such as NumPy, Pandas, Django, or Flask inside processors.
Distributed tables act like named key-value stores backed locally by RocksDB (or optionally Aerospike), with changelog topics for replication and failover. Tables support windowed aggregates with tumbling, hopping, and sliding time windows, and Record models describe how stream keys and values serialize.
The library targets high-throughput pipelines and emphasizes horizontal scaling, standby replicas, and recovery after node failure. Optional pip bundles add Redis caching, YAML codecs, Prometheus or Datadog monitoring, uvloop or eventlet integration, and debug tooling.
Kafka 0.10 or newer is required as the broker. Integrations exist for bridging blocking web frameworks via eventlet and for Tornado or Twisted through asyncio bridges.
Key features
- Kafka topic agents in async Python
- Distributed tables with RocksDB state
- Windowed aggregations
- Typed Record message models
- Changelog replication and failover
- Optional Prometheus and Datadog monitors
- Pluggable Aerospike or Redis extras
- Mypy-friendly static typing
Use cases
- Real-time event pipelines on Kafka
- Stateful stream processing in Python
- Counted metrics sharded by partition key