Metadata-Version: 2.4
Name: kafka-replay
Version: 0.1.0
Summary: A CLI tool to fetch Kafka messages within a specified time range
Project-URL: Homepage, https://github.com/NAGARAJ08/kafka-replay
Project-URL: Repository, https://github.com/NAGARAJ08/kafka-replay
Project-URL: Issues, https://github.com/NAGARAJ08/kafka-replay/issues
Author-email: NAGARAJ K <kbnagaraj18@gmail.com>
License: MIT License
        
        Copyright (c) 2025 NAGARAJ.K
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: Kafka,cli,message replay,time-range
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Python: >=3.7
Requires-Dist: confluent-kafka
Description-Content-Type: text/markdown

# Kafka Replay CLI

[![PyPI version](https://badge.fury.io/py/kafka-replay.svg)](https://pypi.org/project/kafka-replay/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

A simple command-line tool to fetch Kafka messages from a specific time range. Useful for replaying messages or debugging Kafka topics.

---

## 🚀 Installation

Install from PyPI:

```sh
pip install kafka-replay
```
---

🔧 Usage


```sh
kafka-replay --broker <KAFKA_BROKER> --topic <TOPIC> --start-time "<START_TIME>" --end-time "<END_TIME>"
```
Example:
```sh
kafka-replay --broker "localhost:9092" --topic "my_topic" --start-time "2024-03-31 10:00:00" --end-time "2024-03-31 11:00:00"
```
To save the output to a file:

```sh
kafka-replay --broker "localhost:9092" --topic "my_topic" --start-time "2024-03-31 10:00:00" --end-time "2024-03-31 11:00:00" --output results.json
```
---
Using as a Library
You can also use it in Python scripts:

```python
from kafka_replay import KafkaReplay

kafka = KafkaReplay(broker="localhost:9092", topic="my_topic")
messages = kafka.fetch_messages("2024-03-31 10:00:00", "2024-03-31 11:00:00")

print(messages)

```
---

🛠 Features
Fetch Kafka messages between a given time range.

Supports CLI and Python API usage.

Saves output as JSON file (optional).

Graceful error handling.

---
📜 License
This project is licensed under the MIT License - see the LICENSE file for details.
---
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request.
---
Next Steps
Add tests

Improve performance for large data fetches

Support for different output formats (CSV, Parquet, etc.)

---
🌟 Show Your Support

If you find this tool helpful, please consider ⭐ starring the repository on GitHub!
