Skip to main content

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 Producer and AsyncProducer (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


Download files

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

Source Distribution

cursus_client-0.1.0.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

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

cursus_client-0.1.0-py3-none-any.whl (28.4 kB view details)

Uploaded Python 3

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

Hashes for cursus_client-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f41b0b16a8036c12ebf8123c3318275ccf506a4aec5940841d739ad2c5cdbea
MD5 82fa644a7ab1c2d5afac997accb1b2dc
BLAKE2b-256 603f617d48ccd1ff9d2da0b33d014853a516a250d15ff3ab74877601e070114f

See more details on using hashes here.

Provenance

The following attestation bundles were made for cursus_client-0.1.0.tar.gz:

Publisher: release.yml on cursus-io/cursus-python

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

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

Hashes for cursus_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 569baa24ca8d7ccc4fd0a4b57c80e2710a36a7252ce88f877c600e4d1cb06d63
MD5 735c8b1bfa55ef094f5cae608965a550
BLAKE2b-256 3e82413769b458ad17713ecdf1b473df9d9b5484d9a79240ca7b72deaf94fd5c

See more details on using hashes here.

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

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