Python client for the Cursus message broker
Project description
Cursus Python Client
Python client library for the Cursus message broker with sync and async support.
Features
- Producer — Partition batching, compression, idempotent delivery
- Consumer — Polling and streaming modes, consumer groups with rebalance handling
- EventStore — Event sourcing with optimistic concurrency, snapshots
- Sync + Async — Both
ProducerandAsyncProducer(and Consumer, EventStore)
Requirements
- Python 3.10 or later
- A running Cursus broker (default port
9000)
Quick Start
Install
pip install cursus-client
Send a message
from cursus import Producer, ProducerConfig, Acks
config = ProducerConfig(
brokers=["localhost:9000"],
topic="my-topic",
partitions=4,
acks=Acks.ONE,
)
with Producer(config) as p:
seq = p.send("Hello, Cursus!")
p.flush()
print(f"acked={p.unique_ack_count}")
Consume messages
from cursus import Consumer, ConsumerConfig, ConsumerMode
config = ConsumerConfig(
brokers=["localhost:9000"],
topic="my-topic",
group_id="my-group",
mode=ConsumerMode.STREAMING,
)
with Consumer(config) as consumer:
for msg in consumer:
print(f"offset={msg.offset} payload={msg.payload}")
Async
from cursus import AsyncProducer, ProducerConfig
async with AsyncProducer(ProducerConfig(topic="my-topic")) as p:
await p.send("Hello, async!")
await p.flush()
Optional dependencies
pip install cursus-client[snappy] # Snappy compression
pip install cursus-client[lz4] # LZ4 compression
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cursus_client-0.1.0.tar.gz.
File metadata
- Download URL: cursus_client-0.1.0.tar.gz
- Upload date:
- Size: 35.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f41b0b16a8036c12ebf8123c3318275ccf506a4aec5940841d739ad2c5cdbea
|
|
| MD5 |
82fa644a7ab1c2d5afac997accb1b2dc
|
|
| BLAKE2b-256 |
603f617d48ccd1ff9d2da0b33d014853a516a250d15ff3ab74877601e070114f
|
Provenance
The following attestation bundles were made for cursus_client-0.1.0.tar.gz:
Publisher:
release.yml on cursus-io/cursus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cursus_client-0.1.0.tar.gz -
Subject digest:
4f41b0b16a8036c12ebf8123c3318275ccf506a4aec5940841d739ad2c5cdbea - Sigstore transparency entry: 2138333174
- Sigstore integration time:
-
Permalink:
cursus-io/cursus-python@349c48e85064c99ad9018dcec23baedafa95cb9a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cursus-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@349c48e85064c99ad9018dcec23baedafa95cb9a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file cursus_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cursus_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 28.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
569baa24ca8d7ccc4fd0a4b57c80e2710a36a7252ce88f877c600e4d1cb06d63
|
|
| MD5 |
735c8b1bfa55ef094f5cae608965a550
|
|
| BLAKE2b-256 |
3e82413769b458ad17713ecdf1b473df9d9b5484d9a79240ca7b72deaf94fd5c
|
Provenance
The following attestation bundles were made for cursus_client-0.1.0-py3-none-any.whl:
Publisher:
release.yml on cursus-io/cursus-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cursus_client-0.1.0-py3-none-any.whl -
Subject digest:
569baa24ca8d7ccc4fd0a4b57c80e2710a36a7252ce88f877c600e4d1cb06d63 - Sigstore transparency entry: 2138333195
- Sigstore integration time:
-
Permalink:
cursus-io/cursus-python@349c48e85064c99ad9018dcec23baedafa95cb9a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cursus-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@349c48e85064c99ad9018dcec23baedafa95cb9a -
Trigger Event:
workflow_dispatch
-
Statement type: