Local Python SDK for kafkalite
Project description
kafkalite-python
kafkalite-python is a small Python SDK for producing and consuming events through the kafkalite gRPC transport.
Requirements
- Python
3.13+ - A reachable
kafkaliteserver endpoint
Installation
pip install kafkalite-python
Quick Start
import asyncio
from kafkalite import KafkaliteConfig, KafkaliteConsumer, KafkaliteProducer, TopicPartition
async def main() -> None:
config = KafkaliteConfig(brokers=["127.0.0.1:7171"])
producer = KafkaliteProducer(config)
await producer.start()
await producer.send_and_wait("events", value={"message": "hello"})
await producer.stop()
consumer = KafkaliteConsumer(config, group_id="example-group", topics=["events"])
await consumer.start()
message = await consumer.__anext__()
print(message.value)
await consumer.commit({TopicPartition("events"): message.offset + 1})
await consumer.stop()
asyncio.run(main())
Public API
KafkaliteConfig: broker endpoint configurationKafkaliteProducer: async producer adapterKafkaliteConsumer: async consumer adapterPublishAck,ReceivedMessage,TopicPartition: shared transport models
Notes
- The current client uses only the first configured broker endpoint.
- Consumer support is currently limited to partition
0. auto_offset_resetcurrently supports committed offsets or"earliest".
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 kafkalite_python-0.1.3.tar.gz.
File metadata
- Download URL: kafkalite_python-0.1.3.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45a6261d0d1f2c0f849fa26b532ad5f27e95f2825b8424383ef1b4d63fc95f3f
|
|
| MD5 |
58f5dbb4ce48d0fc6913d92450ff47f6
|
|
| BLAKE2b-256 |
2932ebadc8b69179557c4977f26a8d95bc6fbaeb68f138a07b08647e731a55fb
|
File details
Details for the file kafkalite_python-0.1.3-py3-none-any.whl.
File metadata
- Download URL: kafkalite_python-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ad8f1285de667205f474d8f9b2bebf2ffd8fd42b361386d6e1f445258bd7626
|
|
| MD5 |
a61175644262e8167c4ea1a293083c2f
|
|
| BLAKE2b-256 |
cec77341ed3220f9ecfde6b0d1d49694e6ad9e6a53ef6843ff957e6c9697ff20
|