RillKit
Simple publish and consume for Redis and Valkey streams, standalone or cluster. 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
pip install "rillkit[valkey]" # optional valkey-py client
from rillkit import Broker, Stream
orders = Stream("orders", group="workers")
broker = Broker.from_env() # RILLKIT_URL, or RILLKIT_HOST/PORT/...; REDIS_* still work
@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, andXAUTOCLAIM-style takeover of stuck messages - At-least-once delivery with retries (
max_retries, optional exponentialbackoff) - Dead-letter queue with the original id, error and delivery count;
broker.replay_dlq() msg.nack()to retry,msg.reject()(orRejectMessage) to skip retries and go straight to the DLQAckPolicy: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 anIdempotentmiddleware on_startup,after_startup,on_shutdown,after_shutdownhooks 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
datafield holding JSON, so plain redis-py or valkey-py producers interoperate - Redis or Valkey (
RILLKIT_BACKEND=valkey), standalone or Cluster (RILLKIT_MODE=cluster) - Key builders map stream names to keys: the original names on one server, hash-tagged keys on a
cluster so a stream and its DLQ share a slot and the move to the DLQ stays a transaction, plus
prefixes and tenant ids (
HashTagKeys(prefix="billing", tenant="t-42"))
Development
This package is sdks/python in the RillKit repository,
next to the shared specification every
RillKit SDK follows. See CONTRIBUTING.md there for the whole workflow.
cd sdks/python
uv sync --group dev
REDIS_URL=redis://localhost:6379/15 uv run pytest # needs a Redis; only db 15 is flushed
RILLKIT_TEST_BACKEND=valkey REDIS_URL=redis://localhost:6380/15 uv run pytest # valkey-py
../../scripts/test-cluster.sh valkey 7101 # a six-node cluster in Docker
RILLKIT_TEST_BACKEND=valkey RILLKIT_TEST_MODE=cluster \
RILLKIT_TEST_CLUSTER_NODES=127.0.0.1:7101 uv run pytest
Licensed under the Apache License 2.0 (releases up to and including 0.3.0: MIT).
Metadata
Release files for rillkit 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rillkit-0.4.2.tar.gz | 134.3 kB | Without provenance | Details for rillkit-0.4.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rillkit-0.4.2-py3-none-any.whl | Python 3 | none | any | Details for rillkit-0.4.2-py3-none-any.whl |
Total release size: 197.6 kB
Release files / rillkit-0.4.2.tar.gz
| Download URL | rillkit-0.4.2.tar.gz |
|---|---|
| Size | 134.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
819378c66654156caeab764e261f62b948ff0fb7e6b05c9e7d9f9174c13cd0c2
|
|
BLAKE2b-256 checksum How to use checksums |
2aa2ac7ef0eb2e2a343730258418553155b45127390b7179d3e0ed4368b169b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / rillkit-0.4.2-py3-none-any.whl
| Download URL | rillkit-0.4.2-py3-none-any.whl |
|---|---|
| Size | 63.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
776ccf7fbf288619f53f037390fc3095d081a509ed861feb460806cf7007d2de
|
|
BLAKE2b-256 checksum How to use checksums |
603b6ca2b5a5b8f9dad00947f0917fd6140f2f6ddd63ca5287080b88b20ae9a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for rillkit 0.4.2
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.