Skip to main content

Python SDK for wave-mq binary protocol

Project description

wavemq

wavemq is the Python SDK for wave-mq. It provides one client API over two transports:

  • transport="tcp" for the custom binary protocol
  • transport="http" for the broker HTTP API

TCP is the default and is the best fit for binary payloads. HTTP is useful for preview flows and simpler integrations.

Install

python -m pip install wave-python-sdk

Quick start

from wavemq import WaveMQClient

with WaveMQClient("127.0.0.1:7912") as client:
    client.ping()
    client.create_topic("demo", partitions=1, replication_factor=1)
    client.produce("demo", ["hello"], key="demo-key")
    result = client.fetch("demo", 0, offset=0)
    print(result.records[0].value)

HTTP uses the same surface:

from wavemq import WaveMQClient

with WaveMQClient("http://127.0.0.1:8090", transport="http") as client:
    client.ping()
    client.create_topic("demo", partitions=1, replication_factor=1)
    client.produce("demo", ["hello"], key="demo-key")
    result = client.fetch("demo", 0, offset=0)
    print(result.records[0].value)

Helper API

For tiny scripts and preview examples, the client also exposes additive helpers:

  • ensure_topic(...)
  • produce_one(...)
  • produce_many(...)
  • produce_to_partition(...)
  • produce_one_to_partition(...)
  • produce_many_to_partition(...)
  • fetch_from_offset(...)
  • fetch_latest(...)
  • resolve_consume_offset(...)
  • consume_poll(...)

Record also supports content_type, which maps to the canonical content-type header on TCP and to the contentType JSON field on HTTP.

By default, consumer helpers resume from committed + 1 when a group already has state. If the group has no committed offset yet, they start from the earliest available offset. The high-level produce path routes by key and does not let you choose the partition directly. If you need explicit partition control, use the produce_*_to_partition(...) variants.

Examples

Runnable examples live in:

  • examples/python/sdk/tcp
  • examples/python/sdk/http

The TCP folder also contains simple in-file producer/consumer/replay scripts for quick manual checks and offset reruns.

Notes

  • Use transport="tcp" if you need raw bytes and the binary protocol.
  • Use transport="http" if you want a broker-address-only integration path.
  • The package is intentionally small and has no runtime dependencies beyond the standard library.

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

wave_python_sdk-0.2.8.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

wave_python_sdk-0.2.8-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file wave_python_sdk-0.2.8.tar.gz.

File metadata

  • Download URL: wave_python_sdk-0.2.8.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wave_python_sdk-0.2.8.tar.gz
Algorithm Hash digest
SHA256 29e332cfab3cf23a816e7fa1d252f831036c093a551bf763af8dbb329c28c9b2
MD5 5e8973e290673171c4b25056ae9a0764
BLAKE2b-256 1c487d62fa7345f7ded04aa29bcfba6b4f23d25e8981bb621a89dc6df01c4012

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_python_sdk-0.2.8.tar.gz:

Publisher: release.yml on C4erries/wave-python-sdk

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

File details

Details for the file wave_python_sdk-0.2.8-py3-none-any.whl.

File metadata

File hashes

Hashes for wave_python_sdk-0.2.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6183da705b371b07b308c13c8197c7043e0bc6faf4bae79c96a4ab38b72a087b
MD5 39308b6d4e0d0068d16f5ef4b71d7c0c
BLAKE2b-256 c38c162e8cf7c99ebcac14863622ad19448f54287cced9c621811a036449d7db

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_python_sdk-0.2.8-py3-none-any.whl:

Publisher: release.yml on C4erries/wave-python-sdk

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