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.

Why fanferro

  • A consumer you do not have to write. Long polling with 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 with drain timeouts, progress events and no messages stuck behind orphaned long polls.
  • 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 / Discard handler actions, policies for undecodable and unroutable messages.
  • Any message type. Pydantic, dataclasses, msgspec, protobuf, JSON, text, bytes - or your own codec. CloudEvents envelopes (JSON or binary protobuf), raw messages for interop, 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

MIT

Metadata

Release files for fanferro 0.1.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.1.0
File Size Uploaded
fanferro-0.1.0.tar.gz 232.1 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for fanferro 0.1.0
File
fanferro-0.1.0-cp312-abi3-win_arm64.whl CPython 3.12 abi3 Windows ARM64 Details
fanferro-0.1.0-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
fanferro-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl CPython 3.12 abi3 Linux musl 1.2+ x86-64 Details
fanferro-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl CPython 3.12 abi3 Linux musl 1.2+ ARM64 Details
fanferro-0.1.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.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
fanferro-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl CPython 3.12 abi3 macOS 11.0+ x86-64 Details
fanferro-0.1.0-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details

Total release size: 53.7 MB

Release files / fanferro-0.1.0.tar.gz

Download URL fanferro-0.1.0.tar.gz
Size 232.1 kB
Tags Source
SHA-256 checksum
How to use checksums
45b2847da5e1b0cb5d0a0dc5c476380116f6203b28a449a72f57ddad5f77d25d
BLAKE2b-256 checksum
How to use checksums
e221e4629db9b2ae706a45c076e4630ed859dba51a035db6cb6bef4175b651c4
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.0-cp312-abi3-win_arm64.whl
Size 6.7 MB
Tags CPython 3.12 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4595f2371f6103e634eb5ca6c3eb772d2ed7fae4858e01c56f8b042994e38070
BLAKE2b-256 checksum
How to use checksums
8c7442d040fbd6f6f52c30f63c91bd3c5a7bc78305829287c5269a3f78171f40
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.0-cp312-abi3-win_amd64.whl
Size 7.0 MB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
33a5fbf1a34bef97c85653c94f541421e8acdbc9d01d76d44c12683c800858f4
BLAKE2b-256 checksum
How to use checksums
94c147c4b74432c6fba0b2eb569c5f7a6e8d5b92d67f362e0f86c2eb3b8ae47a
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
b3b045ff822d5d5f704c0660de5c158a0472fe906def56a739a5bcda31804ed0
BLAKE2b-256 checksum
How to use checksums
140da1dafdff87b75f6ab3372c32c8f9bab411bfabd9bc93e7bc97a60a689fc1
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.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
91e021f701e0297ad045c4e23d6fb7d9794e0eb0de3c60c08a64617ba1f3f355
BLAKE2b-256 checksum
How to use checksums
c733796cc949bff61daba10278fa26d4ecca088fca11ae629cdb5d1cab34c309
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
94dabc7f30ba14f14ac4081615d76d2b8c39f1d31189ebe32050d5a1053ccc55
BLAKE2b-256 checksum
How to use checksums
75124db7dabc2060e669e848e451db75352f76b099bab19b2179305830f9c70a
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.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
428740e33302222199decdedd29780926609e38e1f6c59b28e9875a52a524bc8
BLAKE2b-256 checksum
How to use checksums
b903381c09cf43e0e49ae392d641c677b553af84b193edc03fb5ef0919ce131d
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.0-cp312-abi3-macosx_11_0_x86_64.whl
Size 6.8 MB
Tags CPython 3.12 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
cfac112772369c7f2704c918230b9099812031cee2e3525b69f54a60d712a6ba
BLAKE2b-256 checksum
How to use checksums
a270939af04e1e637bd43b1fe89e60effec6b48df168039b65635340204ec81a
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 12, 2026.

Transparency log

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

Download URL fanferro-0.1.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
2ac77c05b30b1acbdab0c06281fbb0a01cff03665f6af6a44819251f7ad75bf7
BLAKE2b-256 checksum
How to use checksums
7a1fb1b19737aef1f034ff0bbbf558a4cca57bfebf034bd972989ba4ee8920ff
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 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.0

9 release files

0.4.0

9 release files

0.3.0

9 release files

0.2.0

9 release files

This release

0.1.0 This release

9 release files

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