Last updated:
0 purchases
pyrkafka 0.1.1
pyrkakfa
Description
rdfkafka is a Rust library for working with Kafka in Python. It provides a high-level interface for producing and consuming RDF data using the Kafka messaging system.
Features
Easy integration with Kafka for RDF data processing.
High-level API for producing and consuming RDF messages.
Support for various serialization formats (e.g., JSON, Avro, Protobuf).
Efficient and scalable processing of RDF data.
Installation
You can install rdfkafka using pip:
pip install rdfkafka
Producer Example
from rdfkafka import KafkaProducer
producer = KafkaProducer(bootstrap_servers='localhost:9092')
topic = 'my_topic'
message = 'Hello, Kafka!'
producer.send(topic, message.encode())
Note: producer gets closed when dropped
Consumer Example
from rdfkafka import KafkaConsumer
consumer = KafkaConsumer(bootstrap_servers='localhost:9092')
topic = 'my_topic'
consumer.subscribe(topic)
for message in consumer:
print(message.value.decode())
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.