fanferro
Fast, robust SNS + SQS messaging for Python, powered by a Rust core.
fan-out (SNS → SQS) · fanfare (announcing to a topic) · ferro (iron: the Rust core)
import fanferro
from pydantic import BaseModel # or dataclasses, msgspec, protobuf, ...
@fanferro.message_type("checkout.order_placed.v1")
class OrderPlaced(BaseModel):
order_id: str
amount_cents: int
client = fanferro.Client(
source="urn:service:checkout",
provisioning=fanferro.Provisioning.ensure(), # create missing resources (default: must exist)
)
orders = client.topic("orders")
billing = client.queue("billing", dead_letter=fanferro.DeadLetterQueue("billing-dlq"))
client.subscription(orders, billing)
consumer = client.consumer(billing, concurrency=20)
@consumer.route(OrderPlaced)
async def charge(order: OrderPlaced) -> None:
... # return → ack · raise → retry with backoff → DLQ
async def main() -> None:
async with client: # connect + provision declared resources
await orders.publish(OrderPlaced(order_id="o-1", amount_cents=1299))
await consumer.run() # SIGTERM → graceful drain
Status: 0.x - the API may still change between minor versions.
Why fanferro
- A consumer you do not have to write. Long polling with full receive batches, in-flight limits, prefetch and rate limiting; visibility heartbeats that run on Rust threads (a busy event loop never loses a lease); batched acks; graceful shutdown that stops receiving at once and drains running handlers with timeouts and progress events.
- Failure handling built in. Retry policies with backoff (change visibility or re-enqueue),
max-attempt limits, dead-letter forwarding with error metadata,
Retry/Requeue/Reject/Discardhandler actions, policies for undecodable and unroutable messages. - Any message type. Pydantic, dataclasses, msgspec, protobuf, JSON, text, bytes - or your own codec. Plain message bodies that any SQS/SNS client reads (the default), CloudEvents envelopes (JSON or binary protobuf), or your own envelope.
- Routing by message type, version header, attributes, JSON body fields or SNS topic.
- Large payloads go through S3 automatically (claim checks with bucket/key or presigned URLs, SHA-256 verified, SSRF-safe, AWS Extended Client compatible).
- Declarative infrastructure. Topics, queues, DLQs, subscriptions and queue policies are looked
up, verified for drift, created or updated per resource - with
raise/log/ignore/ custom-fallback failure modes. KMS supported, never required. - Observable. Typed events with per-kind logging control and sync/async hooks; OpenTelemetry spans, metrics and trace propagation through message attributes, CloudEvents or the AWS X-Ray header; on-demand metrics.
- Patterns included. Transactional outbox relay, idempotent consumers, FIFO per-entity ordering.
- Testable. An in-memory SQS/SNS/S3 broker for fast deterministic tests; end-to-end tests run against MiniStack without Docker.
- Typed, async, dependency-free. Python 3.12-3.15, fully typed, no required dependencies; wheels for Linux (x86_64, aarch64; glibc and musl), macOS and Windows.
Install
uv add fanferro # pip install fanferro
uv add "fanferro[all]" # + pydantic, protobuf, msgspec, opentelemetry-api
Learn more
| Getting started | First publisher and consumer, local development |
| Publishing · Consuming | Options, batches, FIFO, routing, concurrency, shutdown |
| Failure handling | Retries, dead-letter queues, poison messages |
| Provisioning | Declaring resources, failure modes, IAM permissions |
| Message formats · Large payloads | Codecs, envelopes, claim checks |
| Observability | Events, logging, hooks, OpenTelemetry, metrics |
| Patterns | Transactional outbox, inbox, fan-out, versioning, ordering |
| Testing · Deployment | In-memory broker, MiniStack, production setup |
| Examples | Runnable examples for every feature |
| Reference | Configuration, events, attributes, errors |
Using an AI coding agent? Point it at fanferro guide (the usage guide shipped with the package)
or copy skills/fanferro into your project's skills.
How it works
The Rust core (crates/fanferro-core) speaks to AWS through the AWS SDK for Rust and owns envelopes,
transport encoding, claim checks, provisioning and the consumer engine. The Python package wraps it
with an asyncio API and everything that touches your objects: codecs, routing, handlers, middleware,
hooks and OpenTelemetry. See docs/architecture.md.
Contributing
See AGENTS.md (for humans and AI agents): uv sync, make check, conventional commits.
License
Metadata
Release files for fanferro 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fanferro-0.4.0.tar.gz | 264.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| fanferro-0.4.0-cp312-abi3-win_arm64.whl | CPython 3.12 | abi3 | Windows ARM64 | Details |
| fanferro-0.4.0-cp312-abi3-win_amd64.whl | CPython 3.12 | abi3 | Windows x86-64 | Details |
| fanferro-0.4.0-cp312-abi3-musllinux_1_2_x86_64.whl | CPython 3.12 | abi3 | Linux musl 1.2+ x86-64 | Details |
| fanferro-0.4.0-cp312-abi3-musllinux_1_2_aarch64.whl | CPython 3.12 | abi3 | Linux musl 1.2+ ARM64 | Details |
| fanferro-0.4.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| fanferro-0.4.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.12 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| fanferro-0.4.0-cp312-abi3-macosx_11_0_x86_64.whl | CPython 3.12 | abi3 | macOS 11.0+ x86-64 | Details |
| fanferro-0.4.0-cp312-abi3-macosx_11_0_arm64.whl | CPython 3.12 | abi3 | macOS 11.0+ ARM64 | Details |
Total release size: 53.5 MB
Release files / fanferro-0.4.0.tar.gz
| Download URL | fanferro-0.4.0.tar.gz |
|---|---|
| Size | 264.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
34ecf625da37349c99beacf2c2e98bff01d26cbb72d3498f3a79dead84b7918b
|
|
BLAKE2b-256 checksum How to use checksums |
f2804343ec2c3660a19f570642a5957511e12ef1f0718d95708729ecd3ca9a23
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-win_arm64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-win_arm64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.12 Windows ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3095cc2ba21ecd5235839c924c8d91c5795df1393da75b1c51b229208f8a1fe3
|
|
BLAKE2b-256 checksum How to use checksums |
2becc043b7a46773a9429ac8c2a25b50e1a1d0daaf377e91b4887d85d0334ac0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-win_amd64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
299ed804500db475e3c2cb09ce8d887d5e361c970e62339d505c2970ecf37015
|
|
BLAKE2b-256 checksum How to use checksums |
a068f1153a990fb85e63ddb5149ead22aebd2c984195120cd8ee409680107c91
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-musllinux_1_2_x86_64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0731c0678db9aaf8bdaf5454ed3dc6dc0b675768786e3fe8310c7714d78d6ca0
|
|
BLAKE2b-256 checksum How to use checksums |
3655f239382700838e4eabeaa6bdafd9c2b7ae8492ac931d7ee9b40d77685abc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-musllinux_1_2_aarch64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.12 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4c99612e83eebed3796b5c4a576f63bcdb29e56338d904de499c740ad1789048
|
|
BLAKE2b-256 checksum How to use checksums |
013032ac15e9a9da24f1dc81386f61bed7044337790492bec336ace3e5023301
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
21c10d131586a7e58729086fb2767a0dda7fb344ce9e2203fc40739482148dfd
|
|
BLAKE2b-256 checksum How to use checksums |
5b503091a9f4f27deb8a2a26b1617723d22b842e028432c6412eb60a970ec2cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
cd68020390bf0dd502a16f1fd154c16cf916822474ca8243b5115db4dd8be222
|
|
BLAKE2b-256 checksum How to use checksums |
b1cad677d87c6eeff4822bb29405da2b0000e28afa000d05dd3c7c310c17463e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-macosx_11_0_x86_64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-macosx_11_0_x86_64.whl |
|---|---|
| Size | 6.7 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
38e9c6b75bbc2ca56eb59fbcd91c537dee4ebc060dcf609dcb1ca33b7c285082
|
|
BLAKE2b-256 checksum How to use checksums |
3e0202e89c4fbf67691a7e1bbd5ac53228ab7bf4b9910f106cfc26a57c7ce3a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency logRelease files / fanferro-0.4.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | fanferro-0.4.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5ff02865c9b7582892e28c8f3d20a79eb4d06303f6fd540a3983c59f32bfbf0f
|
|
BLAKE2b-256 checksum How to use checksums |
e0e7090ecf150da3c08e57bc4c4d13c8a27b7958cfee2b1ef74f2d5ac4f7584a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.
Transparency log