You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The Python client [wraps the rust client](https://www.infinyon.com/blog/2021/03/python-client/).
9
-
* It currently does not support the administrator features that the rust client does.
10
-
* The [PartitionConsumer.stream](https://infinyon.github.io/fluvio-client-python/fluvio.html#PartitionConsumer.stream) returns an object which implements the [python iterator convention](https://wiki.python.org/moin/Iterator) to allow for iterating over the stream in a for-loop.
8
+
The Fluvio Python module provides an extension for working with the Fluvio streaming platform.
11
9
12
-
To see the full docs, visit our [pdoc page](https://infinyon.github.io/fluvio-client-python/fluvio.html).
10
+
This module builds on top of the Fluvio Client Rust Crate and provides a pythonic access to the API.
13
11
14
-
## Examples
15
12
16
-
### Producer
13
+
Creating a topic with default settings is as simple as:
17
14
18
-
Create the topic used to produce and consume records:
19
-
20
-
```bash copy="cmd"
21
-
$ fluvio topic create python-data
15
+
```python
16
+
fluvio_admin = FluvioAdmin.connect()
17
+
fluvio_admin.create_topic("a_topic")
22
18
```
23
19
24
-
Create a file called `python-produce.py`:
20
+
Or just create a topic with custom settings:
25
21
26
22
```python
27
-
#!/usr/bin/env python
28
-
from datetime import datetime
29
-
from fluvio import Fluvio
30
-
31
-
TOPIC_NAME="python-data"
32
-
PARTITION=0
23
+
import fluvio
24
+
25
+
fluvio_admin = FluvioAdmin.connect()
26
+
topic_spec = (
27
+
TopicSpec.create()
28
+
.with_retention_time("1h")
29
+
.with_segment_size("10M")
30
+
.build()
31
+
)
32
+
fluvio_admin.create_topic("a_topic", topic_spec)
33
+
```
33
34
34
-
if__name__=="__main__":
35
-
# Connect to cluster
36
-
fluvio = Fluvio.connect()
35
+
Producing data to a topic in a Fluvio cluster is as simple as:
0 commit comments