Metadata-Version: 2.4
Name: kafka-light-python
Version: 0.1.0
Summary: Local Python SDK for kafka-light
Project-URL: Homepage, https://github.com/paladin-pipeline/paladin-pipeline
Project-URL: Repository, https://github.com/paladin-pipeline/paladin-pipeline
Author: Youngseok Choi
License: MIT
License-File: LICENSE
Keywords: grpc,kafka,sdk,streaming
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.13
Requires-Dist: grpcio>=1.78.0
Requires-Dist: protobuf>=6.31.1
Provides-Extra: dev
Requires-Dist: pyright>=1.1.407; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.3.0; extra == 'dev'
Requires-Dist: pytest>=9.0.0; extra == 'dev'
Requires-Dist: ruff>=0.14.0; extra == 'dev'
Description-Content-Type: text/markdown

# kafka-light-python

`kafka-light-python` is a small Python SDK for producing and consuming events through the `kafka-light` gRPC transport.

## Requirements

- Python `3.13+`
- A reachable `kafka-light` server endpoint

## Installation

```bash
pip install kafka-light-python
```

## Quick Start

```python
import asyncio

from kafka_light import KafkaLightConfig, KafkaLightConsumer, KafkaLightProducer, TopicPartition


async def main() -> None:
    config = KafkaLightConfig(brokers=["127.0.0.1:7171"])

    producer = KafkaLightProducer(config)
    await producer.start()
    await producer.send_and_wait("events", value={"message": "hello"})
    await producer.stop()

    consumer = KafkaLightConsumer(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

- `KafkaLightConfig`: broker endpoint configuration
- `KafkaLightProducer`: async producer adapter
- `KafkaLightConsumer`: async consumer adapter
- `PublishAck`, `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_reset` currently supports committed offsets or `"earliest"`.

## License

MIT
