High-performance Python client for Rivven distributed streaming platform
Project description
rivven-python
Python bindings for the Rivven event streaming platform.
Installation
pip install rivven
Usage
Producer
from rivven import Client, ProducerConfig
client = Client.connect("localhost:9092")
producer = client.producer()
# Send a message
producer.send("my-topic", key=b"user-123", value=b'{"event": "login"}')
# Send with headers
producer.send(
"my-topic",
key=b"user-123",
value=b'{"event": "purchase"}',
headers={"source": "api", "version": "1.0"}
)
# Flush and close
producer.flush()
Consumer
from rivven import Client, ConsumerConfig
client = Client.connect("localhost:9092")
consumer = client.consumer(
group_id="my-group",
topics=["my-topic"]
)
# Poll for messages
for record in consumer.poll(timeout_ms=1000):
print(f"Key: {record.key}, Value: {record.value}")
consumer.commit(record)
# Or use iterator
for record in consumer:
process(record)
consumer.commit(record)
Admin Operations
from rivven import Client
client = Client.connect("localhost:9092")
# Create topic
client.create_topic("new-topic", partitions=3, replication_factor=2)
# List topics
topics = client.list_topics()
for topic in topics:
print(f"{topic.name}: {topic.partitions} partitions")
# Delete topic
client.delete_topic("old-topic")
Async Support
import asyncio
from rivven import AsyncClient
async def main():
client = await AsyncClient.connect("localhost:9092")
producer = await client.producer()
await producer.send("my-topic", key=b"key", value=b"value")
await producer.flush()
asyncio.run(main())
Configuration
from rivven import ClientConfig
config = ClientConfig(
bootstrap_servers=["node1:9092", "node2:9092"],
connection_timeout_ms=10000,
request_timeout_ms=30000,
)
client = Client.connect_with_config(config)
Exception Handling
Rivven provides a hierarchy of exception types for granular error handling:
from rivven import (
RivvenException, # Base exception for all Rivven errors
ConnectionException, # Connection-related errors
ServerException, # Server-side errors
TimeoutException, # Request timeouts
SerializationException, # Serialization/deserialization errors
ConfigException, # Configuration errors
)
try:
client = await rivven.connect("localhost:9092")
except ConnectionException as e:
print(f"Failed to connect: {e}")
except TimeoutException as e:
print(f"Connection timed out: {e}")
except RivvenException as e:
print(f"General Rivven error: {e}")
Building from Source
# Install maturin
pip install maturin
# Build wheel
cd crates/rivven-python
maturin build --release
# Install locally
pip install target/wheels/rivven-*.whl
Documentation
License
Apache-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 Distributions
Built Distributions
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 rivven-0.0.5-cp312-cp312-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: rivven-0.0.5-cp312-cp312-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 614.3 kB
- Tags: CPython 3.12, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ec6ab44b0fcf53e79d860cc65a84796cda9621112fcd0d559af054e037a34b6
|
|
| MD5 |
fa60efc9bfc19e7c6bb836a8b6df213f
|
|
| BLAKE2b-256 |
3b1d8834057001e63577d8be4b0cc1a04237058536acc3b6d06958eba564e64c
|
Provenance
The following attestation bundles were made for rivven-0.0.5-cp312-cp312-manylinux_2_28_aarch64.whl:
Publisher:
release.yml on hupe1980/rivven
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rivven-0.0.5-cp312-cp312-manylinux_2_28_aarch64.whl -
Subject digest:
6ec6ab44b0fcf53e79d860cc65a84796cda9621112fcd0d559af054e037a34b6 - Sigstore transparency entry: 909523067
- Sigstore integration time:
-
Permalink:
hupe1980/rivven@058e9ffda0ef8a38b269410473684b7210fdc786 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/hupe1980
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@058e9ffda0ef8a38b269410473684b7210fdc786 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rivven-0.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: rivven-0.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 632.1 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
975c04c4703d557044897694fdb62c1a157f94a4f9fdec25815782831f3a10b4
|
|
| MD5 |
58c9876e038c2febd3582f6f72e61365
|
|
| BLAKE2b-256 |
1d5b4e703d1b97cd9240d558b93c53e62e71cd18c50585b30e8ffe8ef5ad187d
|
Provenance
The following attestation bundles were made for rivven-0.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on hupe1980/rivven
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rivven-0.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
975c04c4703d557044897694fdb62c1a157f94a4f9fdec25815782831f3a10b4 - Sigstore transparency entry: 909523092
- Sigstore integration time:
-
Permalink:
hupe1980/rivven@058e9ffda0ef8a38b269410473684b7210fdc786 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/hupe1980
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@058e9ffda0ef8a38b269410473684b7210fdc786 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rivven-0.0.5-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: rivven-0.0.5-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 574.9 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9dde041bcc06ffd6c9a77d90da00591d24af19cbcef8c45f19186a387cb4dfaa
|
|
| MD5 |
04214257364265bbc53345cfa0bc0f14
|
|
| BLAKE2b-256 |
56dc3e2a7048e84aa4829d15e093eadc5d07ca53cbb0acacc3429b82626cb63f
|
Provenance
The following attestation bundles were made for rivven-0.0.5-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
release.yml on hupe1980/rivven
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rivven-0.0.5-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
9dde041bcc06ffd6c9a77d90da00591d24af19cbcef8c45f19186a387cb4dfaa - Sigstore transparency entry: 909523118
- Sigstore integration time:
-
Permalink:
hupe1980/rivven@058e9ffda0ef8a38b269410473684b7210fdc786 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/hupe1980
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@058e9ffda0ef8a38b269410473684b7210fdc786 -
Trigger Event:
push
-
Statement type: