Skip to content

Files

This branch is 3 commits behind confluentinc/confluent-kafka-python:master.

examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 12, 2024
Jan 7, 2025
Jan 30, 2024
Dec 12, 2024
Jul 1, 2022
Oct 18, 2024
Oct 10, 2024
Jul 5, 2024
Sep 3, 2020
Sep 14, 2022
Jan 7, 2025
Sep 14, 2022
Dec 12, 2024
Apr 21, 2021
Nov 8, 2022
Mar 9, 2020
Oct 25, 2023
Sep 14, 2022
Jan 7, 2025
Sep 14, 2022
Dec 12, 2024
Oct 15, 2024
Sep 14, 2022
Apr 8, 2019
Sep 14, 2022
Jan 7, 2025
Sep 14, 2022
Dec 12, 2024
Sep 14, 2022

The scripts in this directory provide various examples of using Confluent's Python client for Kafka:

Additional examples for Confluent Cloud:

venv setup

It's usually a good idea to install Python dependencies in a virtual environment to avoid conflicts between projects.

To setup a venv with the latest release version of confluent-kafka and dependencies of all examples installed:

$ python3 -m venv venv_examples
$ source venv_examples/bin/activate
$ pip install confluent_kafka
$ pip install -r requirements/requirements-examples.txt

To setup a venv that uses the current source tree version of confluent_kafka, you need to have a C compiler and librdkafka installed (from a package, or from source). Then:

$ python3 -m venv venv_examples
$ source venv_examples/bin/activate
$ pip install .[examples]

When you're finished with the venv:

$ deactivate