I've done this in the past using Celery. I also used Celery Flower for this app as it's great for monitoring the Celery tasks.
You basically create a scheduled Celery task to consume your desired topic.
I think I used this Kafka client as well.
https://docs.confluent.io/kafka-clients/python/current/overview.htmlhttps://blog.miguelgrinberg.com/post/using-celery-with-flaskhttps://docs.confluent.io/kafka-clients/python/current/overview.html
I used this amazing blog post my Miguel Grinberg: https://blog.miguelgrinberg.com/post/using-celery-with-flask