Skip to main content

Kafka Replay CLI

PyPI version 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:

pip install kafka-replay

🔧 Usage

kafka-replay --broker <KAFKA_BROKER> --topic <TOPIC> --start-time "<START_TIME>" --end-time "<END_TIME>"

Example:

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:

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:

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!

Metadata

Release files for kafka-replay 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kafka-replay 0.1.0
File Size Uploaded
kafka_replay-0.1.0.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kafka-replay 0.1.0
File Interpreter ABI Platform
kafka_replay-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / kafka_replay-0.1.0.tar.gz

Download URL kafka_replay-0.1.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
4468da5fc46fb2bb6878657e1534eb618e81a3f0709c725b9361e5c9a7e6c0a4
BLAKE2b-256 checksum
How to use checksums
b2890cc96676d7d82fdb83bafbe290e1f4a4a430e377698f6ce5de8ae978662d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.7

Release files / kafka_replay-0.1.0-py3-none-any.whl

Download URL kafka_replay-0.1.0-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7026822041f8968bf075388c48aabf2c00b57dc2a42e028be1cc85eed178204
BLAKE2b-256 checksum
How to use checksums
32a836c7525bc788ae7ebbf1d0cb805a4d261519bb244bd583202606b2e1d888
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page