Skip to main content

RabbitMQ pub-sub for the Pico ecosystem: @consumer methods and @publisher clients over aio-pika.

Project description

pico-rabbitmq

PyPI Ask DeepWiki License: MIT CI (tox matrix) codecov Quality Gate Status Duplicated Lines (%) Maintainability Rating PyPI Downloads Docs Interactive Lab

RabbitMQ pub-sub for the pico ecosystem: @consumer methods and declarative @publisher clients over aio-pika. Covers what pico-celery does not: events, fan-out, topic routing.

Installation

pip install pico-rabbitmq

Quick start

rabbitmq:
  url: amqp://guest:guest@rabbit.internal/

Consume — a component method per queue, JSON body decoded for you:

from pico_ioc import component
from pico_rabbitmq import consumer

@component
class OrderProjections:
    @consumer("orders-projection", exchange="events", routing_key="orders.*")
    async def on_order_event(self, message: dict):
        ...

Publish — stubs, like a pico-httpx client:

from pico_rabbitmq import publisher, publish

@publisher
class OrderEvents:
    @publish(exchange="events", routing_key="orders.created")
    def order_created(self, message): ...

Semantics:

  • Consumers and publishers run on a dedicated background loop — works in sync scripts, FastAPI apps and workers alike, no lifespan wiring.
  • Each message resolves its component through the container (prototype scope = fresh instance per message).
  • Ack on success; on exception the message is logged and rejected without requeue (configure a dead-letter exchange to keep failures).
  • Sync publish stubs block until the broker confirms; async stubs await it.
  • Queues and named exchanges are declared durable; the connection closes on container shutdown.

Documentation

Full documentation: https://dperezcabrera.github.io/pico-rabbitmq/

AI Coding Skills

Install Claude Code or OpenAI Codex skills for AI-assisted development with pico-rabbitmq:

curl -sL https://raw.githubusercontent.com/dperezcabrera/pico-skills/main/install.sh | bash

The pico-conventions skill teaches the assistant this module's API surface and invariants; /add-component and /add-tests scaffold components and tests that use it.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pico_rabbitmq-0.1.1.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pico_rabbitmq-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pico_rabbitmq-0.1.1.tar.gz.

File metadata

  • Download URL: pico_rabbitmq-0.1.1.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pico_rabbitmq-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f6f937fb5d91f7c7cfcdb31f51e0104ff3c4b6b41d89615ecbb938f6fafcc6c8
MD5 82e3aa95642e1fa46931dc79e82103c1
BLAKE2b-256 6a20dddd8fb58c7449815fb8829461e4569ce548bd82a02ebf58876288b11c5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pico_rabbitmq-0.1.1.tar.gz:

Publisher: publish-to-pypi.yml on dperezcabrera/pico-rabbitmq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pico_rabbitmq-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pico_rabbitmq-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pico_rabbitmq-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f676790aab076ace6b0d3394e4e66e03b0719f4096d9d78e001b18a16bb30f7f
MD5 041ede81db413afea5d5099ee123fd27
BLAKE2b-256 07fcb76e8e463e19d5748db506760b98a9fad73a3e1f06421640271ae371e5ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for pico_rabbitmq-0.1.1-py3-none-any.whl:

Publisher: publish-to-pypi.yml on dperezcabrera/pico-rabbitmq

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page