This release is a pre-release and may not be stable for production use.
Swarmauri Redis Publisher
swarmauri_publisher_redis provides a Redis Pub/Sub publisher that conforms to the Swarmauri PublishBase interface. The publisher serializes dictionaries to JSON before sending them to Redis channels, making it easy to exchange structured messages across your Swarmauri deployments.
Installation
Choose the workflow that matches your project setup:
# Using pip
pip install swarmauri_publisher_redis
# Using Poetry
poetry add swarmauri_publisher_redis
# Using uv (https://docs.astral.sh/uv/)
uv add swarmauri_publisher_redis
# or install into the active environment
uv pip install swarmauri_publisher_redis
Configuration
RedisPublisher accepts either a complete Redis connection URI or the individual connection settings. Mixing the two configuration styles is not supported.
uri: Full Redis URI such asredis://[:password]@host:port/db.host,port,db: Required whenuriis not provided. The publisher constructs the URI for you.username,password: Optional credentials used when building the URI.
If neither a URI nor the full host/port/db combination is supplied, initialization raises a ValueError.
Usage
The publisher creates a Redis client from your connection information and publishes JSON-encoded payloads.
from swarmauri_publisher_redis import RedisPublisher
publisher = RedisPublisher(
host="localhost",
port=6379,
db=0,
)
publisher.publish("my_channel", {"message": "Hello Redis!"})
Using a Redis URI
You can also configure the publisher with a pre-built connection string:
from swarmauri_publisher_redis import RedisPublisher
publisher = RedisPublisher(uri="redis://localhost:6379/0")
publisher.publish("alerts", {"severity": "info", "detail": "It works!"})
Additional Notes
- Payloads are serialized with
json.dumpsbefore being sent to Redis. - A Redis server must be reachable for the publish call to succeed outside of tests.
Want to help?
If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.
Metadata
Release files for swarmauri_publisher_redis 0.11.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| swarmauri_publisher_redis-0.11.0.dev1.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| swarmauri_publisher_redis-0.11.0.dev1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / swarmauri_publisher_redis-0.11.0.dev1.tar.gz
| Download URL | swarmauri_publisher_redis-0.11.0.dev1.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75180713850031a2022dc32e409055fb97222feb6931c0a2ee5001d2743a30a2
|
|
BLAKE2b-256 checksum How to use checksums |
6ea5dff749d8744b993f73a135e5d2f898b7e6b149307b771f7a08a721042656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / swarmauri_publisher_redis-0.11.0.dev1-py3-none-any.whl
| Download URL | swarmauri_publisher_redis-0.11.0.dev1-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d981bbee9de34c18310dee9e75e152c366acb1df2afb52296a179b38a88cc00c
|
|
BLAKE2b-256 checksum How to use checksums |
5ee0fdba6d9fe3faf3ca97e515765f51c5b57c627e0a91b183619e9cc1e0e8f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|