title: Is there a Python API for event-driven Kafka consumer?
body: <p>I have been trying to build a Flask app that has Kafka as the only interface. For this reason, I want have a Kafka consumer that is triggered when there is new message in the stream of the concerned topic and respond by pushing messages back to the Kafka stream.</p>
  
  <p>I have been looking for something like the Spring implementation:</p>
  
  <pre><code>@KafkaListener(topics = "mytopic", groupId = "mygroup")
  public void listen(String message) {
      System.out.println("Received Messasge in group mygroup: " + message);
  }
  </code></pre>
  
  <p>I have looked at:</p>
  
  <ol>
  <li><a href="https://kafka-python.readthedocs.io/en/master/index.html" rel="noreferrer">kafka-python</a></li>
  <li><a href="https://pykafka.readthedocs.io/en/latest/index.html" rel="noreferrer">pykafka</a></li>
  <li><a href="https://docs.confluent.io/current/clients/confluent-kafka-python/" rel="noreferrer">confluent-kafka</a></li>
  </ol>
  
  <p>But I couldn't find anything related to event-driven style of implementation in Python.</p>