Skip to main content

RillKit

Simple publish and consume for Redis Streams. Consumer groups, retries with backoff, a dead-letter queue, ack policies, middleware and lifecycle hooks, without the boilerplate.

Docs: https://nimzymaina.github.io/rillkit/

pip install rillkit             # plain dict bodies
pip install "rillkit[pydantic]" # optional typed bodies
from rillkit import Broker, Stream

orders = Stream("orders", group="workers")
broker = Broker.from_env()  # REDIS_URL, or REDIS_HOST / REDIS_PORT / REDIS_PASSWORD / REDIS_SSL


@broker.subscribe(orders, max_retries=3)
def handle(order: dict):
    print("got", order)


if __name__ == "__main__":
    broker.publish(orders, {"id": 1})
    broker.run()  # blocks; Ctrl-C / SIGTERM finishes the current message and exits

Features

  • Consumer groups: group creation, XREADGROUP, and XAUTOCLAIM-style takeover of stuck messages
  • At-least-once delivery with retries (max_retries, optional exponential backoff)
  • Dead-letter queue with the original id, error and delivery count; broker.replay_dlq()
  • msg.nack() to retry, msg.reject() (or RejectMessage) to skip retries and go straight to the DLQ
  • AckPolicy: NACK_ON_ERROR (default), ACK_ALWAYS, ACK_FIRST, MANUAL
  • Plain dicts by default, Pydantic models when you annotate the handler with one
  • Middleware hooks (on_receive, consume_scope, publish_scope, after_processed) and an Idempotent middleware
  • on_startup, after_startup, on_shutdown, after_shutdown hooks and graceful SIGTERM shutdown
  • Worker heartbeats: broker.active_workers(stream) includes idle workers
  • Stack @broker.publisher(...) under @broker.subscribe(...) to publish a handler's return value
  • The wire format is a single data field holding JSON, so plain redis-py producers interoperate

Development

uv sync --group dev
REDIS_URL=redis://localhost:6379/15 uv run pytest   # needs a Redis
npm install && npm run docs:dev                     # docs

MIT licensed.

Metadata

Release files for rillkit 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 rillkit 0.1.0
File Size Uploaded Provenance Actions
rillkit-0.1.0.tar.gz 21.8 kB Without provenance Details for rillkit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rillkit 0.1.0
File Interpreter ABI Platform Actions
rillkit-0.1.0-py3-none-any.whl Python 3 none any Details for rillkit-0.1.0-py3-none-any.whl

Total release size: 37.7 kB

Release files / rillkit-0.1.0.tar.gz

Download URL rillkit-0.1.0.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bd8bd5db6883914db5dc6240e65ba25e0153bc53365f3860a17c0699c386d2eb
BLAKE2b-256 checksum
How to use checksums
4e4e5df47072717727cbe6be68512bb6dae39b3ea0a31a89c6a202bba3e84c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / rillkit-0.1.0-py3-none-any.whl

Download URL rillkit-0.1.0-py3-none-any.whl
Size 15.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c6e0f517ab122d8e0e11229114396fe371f6440273228ebc9a8753bc8746cbf
BLAKE2b-256 checksum
How to use checksums
27c14444d7deb6e34ba706b08f4c752b1ba48a3cbe2da0cda558b5f1a0bcf405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for rillkit 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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