Sets up kafka-python with Apache Kafka on Heroku
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
LICENSE Put more details in README Sep 19, 2016
requirements.txt Remove self-requirement Sep 17, 2016
setup.cfg Support Python 3 Mar 15, 2017


kafka_helper makes it easy to use the kafka-python library with Apache Kafka on Heroku. It takes care of parsing the Kafka config vars and establishing an SSL context.


pip install kafka-helper


import kafka_helper

To get a producer and write some values to a topic:

producer = kafka_helper.get_kafka_producer()
producer.send('my-topic', key='my key', value={'k': 'v'})

To get a consumer of a topic and iterate over its stream:

consumer = kafka_helper.get_kafka_consumer(topic='my-topic')
for message in consumer:
    print message