rivven 0.0.1__cp312-cp312-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rivven
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Classifier: Development Status :: 4 - Beta
|
|
5
|
+
Classifier: Intended Audience :: Developers
|
|
6
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
14
|
+
Classifier: Programming Language :: Rust
|
|
15
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
16
|
+
Classifier: Topic :: System :: Distributed Computing
|
|
17
|
+
Classifier: Framework :: AsyncIO
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Dist: pytest>=7.0 ; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest-asyncio>=0.21 ; extra == 'dev'
|
|
21
|
+
Requires-Dist: mypy>=1.0 ; extra == 'dev'
|
|
22
|
+
Requires-Dist: ruff>=0.1 ; extra == 'dev'
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Summary: High-performance Python client for Rivven distributed streaming platform
|
|
25
|
+
Keywords: streaming,kafka,messaging,distributed,async
|
|
26
|
+
License: Apache-2.0
|
|
27
|
+
Requires-Python: >=3.8
|
|
28
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
29
|
+
Project-URL: Documentation, https://github.com/hupe1980/rivven/tree/main/crates/rivven-python
|
|
30
|
+
Project-URL: Homepage, https://github.com/hupe1980/rivven
|
|
31
|
+
Project-URL: Repository, https://github.com/hupe1980/rivven
|
|
32
|
+
|
|
33
|
+
# rivven-python
|
|
34
|
+
|
|
35
|
+
Python bindings for Rivven using PyO3.
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
pip install rivven
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
### Producer
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
from rivven import Client, ProducerConfig
|
|
49
|
+
|
|
50
|
+
client = Client.connect("localhost:9092")
|
|
51
|
+
producer = client.producer()
|
|
52
|
+
|
|
53
|
+
# Send a message
|
|
54
|
+
producer.send("my-topic", key=b"user-123", value=b'{"event": "login"}')
|
|
55
|
+
|
|
56
|
+
# Send with headers
|
|
57
|
+
producer.send(
|
|
58
|
+
"my-topic",
|
|
59
|
+
key=b"user-123",
|
|
60
|
+
value=b'{"event": "purchase"}',
|
|
61
|
+
headers={"source": "api", "version": "1.0"}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
# Flush and close
|
|
65
|
+
producer.flush()
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Consumer
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from rivven import Client, ConsumerConfig
|
|
72
|
+
|
|
73
|
+
client = Client.connect("localhost:9092")
|
|
74
|
+
consumer = client.consumer(
|
|
75
|
+
group_id="my-group",
|
|
76
|
+
topics=["my-topic"]
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Poll for messages
|
|
80
|
+
for record in consumer.poll(timeout_ms=1000):
|
|
81
|
+
print(f"Key: {record.key}, Value: {record.value}")
|
|
82
|
+
consumer.commit(record)
|
|
83
|
+
|
|
84
|
+
# Or use iterator
|
|
85
|
+
for record in consumer:
|
|
86
|
+
process(record)
|
|
87
|
+
consumer.commit(record)
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Admin Operations
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from rivven import Client
|
|
94
|
+
|
|
95
|
+
client = Client.connect("localhost:9092")
|
|
96
|
+
|
|
97
|
+
# Create topic
|
|
98
|
+
client.create_topic("new-topic", partitions=3, replication_factor=2)
|
|
99
|
+
|
|
100
|
+
# List topics
|
|
101
|
+
topics = client.list_topics()
|
|
102
|
+
for topic in topics:
|
|
103
|
+
print(f"{topic.name}: {topic.partitions} partitions")
|
|
104
|
+
|
|
105
|
+
# Delete topic
|
|
106
|
+
client.delete_topic("old-topic")
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Async Support
|
|
110
|
+
|
|
111
|
+
```python
|
|
112
|
+
import asyncio
|
|
113
|
+
from rivven import AsyncClient
|
|
114
|
+
|
|
115
|
+
async def main():
|
|
116
|
+
client = await AsyncClient.connect("localhost:9092")
|
|
117
|
+
producer = await client.producer()
|
|
118
|
+
|
|
119
|
+
await producer.send("my-topic", key=b"key", value=b"value")
|
|
120
|
+
await producer.flush()
|
|
121
|
+
|
|
122
|
+
asyncio.run(main())
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## Configuration
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from rivven import ClientConfig
|
|
129
|
+
|
|
130
|
+
config = ClientConfig(
|
|
131
|
+
bootstrap_servers=["node1:9092", "node2:9092"],
|
|
132
|
+
connection_timeout_ms=10000,
|
|
133
|
+
request_timeout_ms=30000,
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
client = Client.connect_with_config(config)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Building from Source
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Install maturin
|
|
143
|
+
pip install maturin
|
|
144
|
+
|
|
145
|
+
# Build wheel
|
|
146
|
+
cd crates/rivven-python
|
|
147
|
+
maturin build --release
|
|
148
|
+
|
|
149
|
+
# Install locally
|
|
150
|
+
pip install target/wheels/rivven-*.whl
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## License
|
|
154
|
+
|
|
155
|
+
See root [LICENSE](../../LICENSE) file.
|
|
156
|
+
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
rivven/_rivven.cpython-312-darwin.so,sha256=NWfsMf76HvBtHMjd4-nBCpqJfIsZGtM-62rYre-ngyM,1784704
|
|
2
|
+
rivven-0.0.1.dist-info/METADATA,sha256=YGMmmRmtUQHYmTtw3D9l33C-YkR2ONG621VK9bqa1VU,3617
|
|
3
|
+
rivven-0.0.1.dist-info/WHEEL,sha256=qr8B0oB3ZR0cwIaW0mxUADH9b4sNRMHcgJlpYNTDAPw,105
|
|
4
|
+
rivven-0.0.1.dist-info/RECORD,,
|