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", 0, ["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", 0, ["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(...)
  • 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.

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.7.tar.gz (13.7 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.7-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wave_python_sdk-0.2.7.tar.gz
  • Upload date:
  • Size: 13.7 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.7.tar.gz
Algorithm Hash digest
SHA256 d9ecc03df9542eea8c9a36c05e545b85e654a06fda52c415dc0e1c6e4bb7156a
MD5 53ecaddace93bc6c1d34e2847d8a6be2
BLAKE2b-256 7eb6a8a96cdee2e6de117b6d9800036e984563d74c624a61e83d434a71e977fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_python_sdk-0.2.7.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.7-py3-none-any.whl.

File metadata

File hashes

Hashes for wave_python_sdk-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 2a754326ae89cdcf935b852449e5f13d8ea717139da164a0771e9fc5b810f39f
MD5 22c7a27e007334a384ab0b7bf8fe6676
BLAKE2b-256 16c99345ad970369c5aeb01d4cbd64083640a92fb48535439b58e77f9a1a0509

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_python_sdk-0.2.7-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