Skip to main content

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.

Install

uv add fanferro                   # pip install fanferro
uv add "fanferro[all]"            # + pydantic, protobuf, msgspec, opentelemetry-api

Highlights

  • Handlers are plain typed functions. Return to ack, raise to retry. No receipt handles.
  • Your own types. Pydantic, dataclasses, msgspec, protobuf, JSON or raw bytes.
  • Routing on anything. Message type, attribute, body field or topic.
  • Safe by default. Heartbeats, retries with backoff, dead-letter queues, graceful shutdown.
  • Infrastructure in code. Declared queues, topics and subscriptions are checked or created.
  • Tests without AWS or Docker. An in-memory broker runs the same engine you deploy.
  • Mistakes caught early. Bad names, sizes and signatures fail before any network call.
  • Observable. Typed events, structured logs, hooks and OpenTelemetry.
  • The hard parts included. Large payloads via S3, outbox, idempotency, FIFO ordering.
  • Fast. A Rust core, full batches and little Python work per message.
  • No required dependencies. Fully typed, Python 3.12-3.15, wheels for Linux, macOS, Windows.

Performance

  • Rust does the heavy lifting. Signing, HTTP, the SQS and SNS protocols and batching.
  • Full batches, overlapping. Messages are received ten at a time, the next batch prefetched.
  • Acks don't block handlers. Deletes are batched in the background while the next message runs.
  • Little Python per message. Only your codecs, routing and handlers run on the event loop.
  • Lean defaults. Small messages, no redundant checksums, no tracing work unless enabled.

Benchmarks and how to run them: Performance.

Real AWS, emulators and the in-memory broker

fanferro runs on real AWS, on the AWS emulators MiniStack and LocalStack, and on its in-memory broker. Real AWS is the reference: probes run the same scenarios and raw API calls on each target, and the in-memory broker follows AWS wherever they found a difference, with AWS's error codes and texts.

Target Use it for How it differs from AWS
Real AWS Production It is the reference
In-memory broker (fanferro.testing.memory_client()) Tests without AWS or Docker No credentials, and other accounts' queues and topics are just missing; filter policy errors leave out the parser position SNS appends; long polls that a stopping consumer aborts end at once (MemoryBroker(orphaned_polls=True) serves them as SQS does)
MiniStack End-to-end tests without Docker Accepts many queue and SNS attributes, names and FIFO ids that AWS refuses; differs in receipt handles of earlier receives, Number values, numeric filters on String attributes, and X-Ray headers and Binary values through SNS
LocalStack End-to-end tests with Docker Accepts out-of-range queue attributes and a dead-letter queue of the other type; differs in FIFO receipt handles and duplicates, Number values, wildcard filters and presigned URL expiry

Neither emulator enforces SQS's 60 seconds between deleting a queue and creating it again or between two purges, drops SNS deliveries to queues encrypted with alias/aws/sqs as AWS does, or refuses unknown credentials. Every finding, the recorded runs and how to probe an account of your own: Parity with AWS.

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
Architecture How it is built and why, with decision records

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.

Contributing

See AGENTS.md (for humans and AI agents): uv sync, make check, conventional commits.

License

MIT

Metadata

Release files for fanferro 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fanferro 0.8.0
File Size Uploaded Provenance Actions
fanferro-0.8.0.tar.gz 363.0 kB With provenance Details for fanferro-0.8.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for fanferro 0.8.0
File Actions
fanferro-0.8.0-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details for fanferro-0.8.0-cp312-abi3-win_arm64.whl
fanferro-0.8.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details for fanferro-0.8.0-cp312-abi3-win_amd64.whl
fanferro-0.8.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details for fanferro-0.8.0-cp312-abi3-musllinux_1_2_x86_64.whl
fanferro-0.8.0-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details for fanferro-0.8.0-cp312-abi3-musllinux_1_2_aarch64.whl
fanferro-0.8.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details for fanferro-0.8.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
fanferro-0.8.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details for fanferro-0.8.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
fanferro-0.8.0-cp312-abi3-macosx_11_0_x86_64.whl CPython 3.12 abi3 macOS 11.0+ x86-64 Details for fanferro-0.8.0-cp312-abi3-macosx_11_0_x86_64.whl
fanferro-0.8.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details for fanferro-0.8.0-cp312-abi3-macosx_11_0_arm64.whl

Total release size: 55.3 MB

Release files / fanferro-0.8.0.tar.gz

Download URL fanferro-0.8.0.tar.gz
Size 363.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2599ca20df2944ddc465bdbbd99347c6ab51b636bf7d85c847e6a70556c5376f
BLAKE2b-256 checksum
How to use checksums
311fbc2055d3bfd199ddb701813025dcf20fa246ac3feb03060ea3206626ad58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-win_arm64.whl

Download URL fanferro-0.8.0-cp312-abi3-win_arm64.whl
Size 6.9 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
cac2665c83bc8a63c8d1ac63607858ab1d7afda36ada8d9f924ea1f3c3f03c12
BLAKE2b-256 checksum
How to use checksums
0a24c3b3f1e7ae78fcb28890919d327b7415d83dbd2e52d32852cfb1d956e626
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-win_amd64.whl

Download URL fanferro-0.8.0-cp312-abi3-win_amd64.whl
Size 7.2 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
98937bbbaa09401fe9c3a6dec01a85568db6ee7d78307fdaa1a600e04567803a
BLAKE2b-256 checksum
How to use checksums
51eef9efe75f6cae5af05b362c8fc89c5ae7da9f9444b27dc86d82d6d88d6a61
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-musllinux_1_2_x86_64.whl

Download URL fanferro-0.8.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 7.2 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
f989b1487b38697304dfcd2e506a54b971b41b6ee17f3f755dd61b8c32113a38
BLAKE2b-256 checksum
How to use checksums
d627f1a5d69f0bbf5a13116441c5d06e67cbd1a050f764e8bbb8f24fece6e634
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-musllinux_1_2_aarch64.whl

Download URL fanferro-0.8.0-cp312-abi3-musllinux_1_2_aarch64.whl
Size 6.8 MB
Tags CPython 3.12 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
c4fbc3d6b258b03245e3a94a14f8e2a222ed3269454ef059fa5811cea376d4ab
BLAKE2b-256 checksum
How to use checksums
357e8796c2b07f49fdbb253993d818c087a309fad3f5cc7325f74cde45684333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL fanferro-0.8.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
12df888650c7a993db3e81947a18278559e864b31abed7e2fa6b66a1d95743a5
BLAKE2b-256 checksum
How to use checksums
8b7cf6ead8582d059a039b92891dfe1bb7fb9658a5ef37bcf3ce076345a4922e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL fanferro-0.8.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.8 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
afcfd1dbe9a5a2fc64767b628c339a8e12c79df1e2eb7ba36bbfceb607599745
BLAKE2b-256 checksum
How to use checksums
8ca58197af84f65ec35f819fd87a4b163c6a904dcc9a2f023fc74639bdf03b6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-macosx_11_0_x86_64.whl

Download URL fanferro-0.8.0-cp312-abi3-macosx_11_0_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
fb32bbfafe1c42143b1e94692613b7acf07bf9b5d431df478396fae6f8da2b07
BLAKE2b-256 checksum
How to use checksums
9af3ee872b932ada13e3c8bd4c782b3c16a2efce05e61b19c2ab49060c8a5ef7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Release files / fanferro-0.8.0-cp312-abi3-macosx_11_0_arm64.whl

Download URL fanferro-0.8.0-cp312-abi3-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b1f069c2556056ad7ab178ede108af1ab7d54ab7a7efd74dd64723dc26b1f9d9
BLAKE2b-256 checksum
How to use checksums
d483cdfa57ffea1ef48cd6db1fa3a503a222bc52df2c14f6ea35da9fb9197a67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 1, 2026.

Transparency log

Security for fanferro 0.8.0

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.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for fanferro-0.8.0.tar.gz

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 Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page