Skip to main content

Python bindings for rdkafka Rust library

Project description

pyrkafka: Python Wrapper for rdkafka (Rust)

PyPI version License

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

pyrkafka-0.2.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyrkafka-0.2.0-cp313-abi3-win_amd64.whl (3.5 MB view details)

Uploaded CPython 3.13+Windows x86-64

pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ x86-64

pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl (4.0 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ ARM64

pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl (3.4 MB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.13+macOS 10.12+ x86-64

pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Hashes for pyrkafka-0.2.0.tar.gz
Algorithm Hash digest
SHA256 00f73b55cecfac21f5feed62b42e952c1624517e8e269e12398a25406732d22e
MD5 9f1eb180ee97b88e0c968f9e244cedc7
BLAKE2b-256 5a537b2f0a04dd5a4fb444638fa158b2d2db58da4289e722712df8761cc752d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrkafka-0.2.0.tar.gz:

Publisher: release.yaml on Miggets7/pyrkafka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for pyrkafka-0.2.0-cp313-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bdd2fbf3dc1c73762d94854128f7b7dafdb9b50715691baa72d9d0b9c4c86b7e
MD5 86faab97b4a833fb5bb9f40744b30ba9
BLAKE2b-256 01c316d9711f3e914e0abdc3b1bcefbd9e047a2ddb8948938ef5d1d0ff9f914b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyrkafka-0.2.0-cp313-abi3-win_amd64.whl:

Publisher: release.yaml on Miggets7/pyrkafka

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 856bd447902f63617c5610f85a2f215948a9c02cc4c24f6e39c514e1fddc6db5
MD5 6bf20637a3dc2236e9d3f699cb21a6b5
BLAKE2b-256 a18eb070259e2352e6e0d655d0ea526e95dcdebb6ec778c02312fff6a7db3cb1

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pyrkafka-0.2.0-cp313-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1b33cb621472865d556e369c03932d7a42b76ca698f8958c26427ab2fbb6719f
MD5 a55d83db2b8fd1190e46a5f9d0cebe5e
BLAKE2b-256 96f62883db33271ec4d70c4601b9b71101bc10cabbb6a6134fea66643f21f130

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyrkafka-0.2.0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f181ba3886d4fa40d56be4afe70a45ce2f3868e19a8f14e67a26215b28f28d7e
MD5 a4d02a06b259b3091bfa8ef3e8acef37
BLAKE2b-256 67142a86cd9f91a5004bcc993b9d9a8ca6d917680246c8754a782f40d5242c4d

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyrkafka-0.2.0-cp313-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0441c2f82418efd5b0291dd5dca56b53bf8b7877b5b054a4ee3197015b3350b5
MD5 1af1495c4f813122561b07c94db9d9dd
BLAKE2b-256 6ace0043b8c6e3f5d0a585bade6acaab2fdbaaae31b126c699cf14ddbea7b6dd

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyrkafka-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 751597729edf428086368226e298f3f3bcdd2486b2f3d02053ea56ea4e5d3bac
MD5 2629d12beff6313670a596636d0ba926
BLAKE2b-256 707182521f564fefe62f3b6d05a5917bc76e890fb3154ded6c6a718f47b2ea61

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page