Python bindings for rdkafka Rust library
Project description
pyrkafka: Python Wrapper for rdkafka (Rust)
Python Library for Apache Kafka
pyrkafka is a Python wrapper around the rdkafka Rust library. It provides a high-level Pythonic API for producing and consuming Kafka messages, leveraging the performance and safety of Rust via PyO3.
Installation
pip install pyrkafka
Requires Python 3.13+.
Getting Started
Producing Messages
from pyrkafka import PyrKafkaProducer
producer = PyrKafkaProducer("localhost:9092")
# Send a message (partitioned round-robin)
producer.produce("my_topic", b"Hello, Kafka!")
# Send with a key (messages with the same key go to the same partition)
producer.produce_with_key("my_topic", b"Hello, Kafka!", "my_key")
# Flush pending messages (also happens automatically when the producer is dropped)
producer.flush()
Consuming Messages
from pyrkafka import PyrKafkaConsumer
consumer = PyrKafkaConsumer("localhost:9092", "my_topic", "my_group")
for message in consumer:
print(message.decode())
Custom Configuration
Both producer and consumer accept an optional config dict for additional librdkafka configuration:
producer = PyrKafkaProducer("localhost:9092", config={
"message.timeout.ms": "5000",
"compression.type": "zstd",
})
consumer = PyrKafkaConsumer("localhost:9092", "my_topic", "my_group", config={
"auto.offset.reset": "latest",
"enable.auto.commit": "false",
})
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrkafka-0.2.0.tar.gz.
File metadata
- Download URL: pyrkafka-0.2.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00f73b55cecfac21f5feed62b42e952c1624517e8e269e12398a25406732d22e
|
|
| MD5 |
9f1eb180ee97b88e0c968f9e244cedc7
|
|
| BLAKE2b-256 |
5a537b2f0a04dd5a4fb444638fa158b2d2db58da4289e722712df8761cc752d3
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0.tar.gz:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0.tar.gz -
Subject digest:
00f73b55cecfac21f5feed62b42e952c1624517e8e269e12398a25406732d22e - Sigstore transparency entry: 985855564
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp313-abi3-win_amd64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp313-abi3-win_amd64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.13+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdd2fbf3dc1c73762d94854128f7b7dafdb9b50715691baa72d9d0b9c4c86b7e
|
|
| MD5 |
86faab97b4a833fb5bb9f40744b30ba9
|
|
| BLAKE2b-256 |
01c316d9711f3e914e0abdc3b1bcefbd9e047a2ddb8948938ef5d1d0ff9f914b
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-win_amd64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp313-abi3-win_amd64.whl -
Subject digest:
bdd2fbf3dc1c73762d94854128f7b7dafdb9b50715691baa72d9d0b9c4c86b7e - Sigstore transparency entry: 985855627
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.13+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
856bd447902f63617c5610f85a2f215948a9c02cc4c24f6e39c514e1fddc6db5
|
|
| MD5 |
6bf20637a3dc2236e9d3f699cb21a6b5
|
|
| BLAKE2b-256 |
a18eb070259e2352e6e0d655d0ea526e95dcdebb6ec778c02312fff6a7db3cb1
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
856bd447902f63617c5610f85a2f215948a9c02cc4c24f6e39c514e1fddc6db5 - Sigstore transparency entry: 985855682
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 4.0 MB
- Tags: CPython 3.13+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1b33cb621472865d556e369c03932d7a42b76ca698f8958c26427ab2fbb6719f
|
|
| MD5 |
a55d83db2b8fd1190e46a5f9d0cebe5e
|
|
| BLAKE2b-256 |
96f62883db33271ec4d70c4601b9b71101bc10cabbb6a6134fea66643f21f130
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
1b33cb621472865d556e369c03932d7a42b76ca698f8958c26427ab2fbb6719f - Sigstore transparency entry: 985855748
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.13+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f181ba3886d4fa40d56be4afe70a45ce2f3868e19a8f14e67a26215b28f28d7e
|
|
| MD5 |
a4d02a06b259b3091bfa8ef3e8acef37
|
|
| BLAKE2b-256 |
67142a86cd9f91a5004bcc993b9d9a8ca6d917680246c8754a782f40d5242c4d
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl -
Subject digest:
f181ba3886d4fa40d56be4afe70a45ce2f3868e19a8f14e67a26215b28f28d7e - Sigstore transparency entry: 985855809
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.3 MB
- Tags: CPython 3.13+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0441c2f82418efd5b0291dd5dca56b53bf8b7877b5b054a4ee3197015b3350b5
|
|
| MD5 |
1af1495c4f813122561b07c94db9d9dd
|
|
| BLAKE2b-256 |
6ace0043b8c6e3f5d0a585bade6acaab2fdbaaae31b126c699cf14ddbea7b6dd
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl -
Subject digest:
0441c2f82418efd5b0291dd5dca56b53bf8b7877b5b054a4ee3197015b3350b5 - Sigstore transparency entry: 985855848
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@63541d4494e54457eb9da849ba923de913a60add -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@63541d4494e54457eb9da849ba923de913a60add -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 3.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
751597729edf428086368226e298f3f3bcdd2486b2f3d02053ea56ea4e5d3bac
|
|
| MD5 |
2629d12beff6313670a596636d0ba926
|
|
| BLAKE2b-256 |
707182521f564fefe62f3b6d05a5917bc76e890fb3154ded6c6a718f47b2ea61
|
Provenance
The following attestation bundles were made for pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl:
Publisher:
release.yaml on Miggets7/pyrkafka
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl -
Subject digest:
751597729edf428086368226e298f3f3bcdd2486b2f3d02053ea56ea4e5d3bac - Sigstore transparency entry: 1017894431
- Sigstore integration time:
-
Permalink:
Miggets7/pyrkafka@18d7ba1c381b7446964e0d94e5944be0e4ebad5c -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/Miggets7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@18d7ba1c381b7446964e0d94e5944be0e4ebad5c -
Trigger Event:
push
-
Statement type: