The python client wraps the rust client and uses nearly the exact same function definitions. It currently does not support the administrator features that the rust client does. Handling async runners across the rust FFI is a bit tricky so for now, this client does not support async python.
To see the full docs, visit our pdoc page.
To connect to fluvio do:
from fluvio import Fluvio fluvio = Fluvio.connect()
To get a producer do:
producer = fluvio.topic_producer("my-topic")
To send a record for the producer do:
send is also available. You will need to convert your key/value into a byte array
first to use it.
To get a consumer, do:
partition = 0 consumer = fluvio.partition_consumer("my-topic", partition)
To get a stream from the consumer do:
from fluvio import Offset stream = consumer.stream(Offset.beginning()) for i in stream: key = i.key_string() value = i.value_string() print("%s - %s" % (key, value))