Skip to main content

Python CLI for managing a kafka cluster

Project description

version codecov docs

Kafkapy

A python command line interface for inspection and management of a kafka cluster. kafkapy is a single utility for all management and inspection actions. I wrote this tool when working with AWS MSK as dealing with many different utility scripts from confluence was combersome and often required additional pre/post processing of the data which is not in a suitable format for piping etc, thus kafkapy was born.

kafkapy aims to implement all the actions supported by the confluence utility scripts, but also plans to build in testability for common tasks, such as calculating the sum of all offset lag across all partitions for a topic etc.

All output from kafkapy to stdout is fully compliant json and suitable for piping to tools etc.

[!CAUTION] Kafkapy requires broker versions 0.11.0.0 or greater.


Quick Start

kafkapy is very simple to use, you need two simple things to get started.

# install the python package:
pip install kafkapy

# to get started:
kafkapy --help

[!TIP] Ensure your kafka cluster is up and running.

In order to interact with kafka, you should create a properties.yaml file on disk and provide it's path to any commands, the properties.yaml file will honour any librdkafka properties. By default kafkapy will look inside ~/.kafkapy/properties.yaml as a fallback should you not provide the option explicitly via --properties.

Additionally all commands take an (Optional) --bootstrap-servers (List) option which you can specify the broker addresses manually, these are also available via librdkafka config via the bootstrap.servers property so can reside in your properties.yaml file if you so choose.

[!TIP] Ensure your ~/.kafkapy/properties.yaml contains appropriate properties for auth etc.

View librdkafka properties Here

[!TIP] kafkapy looks great, but when piping to other tooling colour is automatically excluded for unix compatibility


User Guide

[!TIP] For full examples, visit the user guide at: https://symonk.github.io/kafkapy/


Contributing

If you want to contribute with Kafkapy check out the Contributing Guide to learn how to start.

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

kafkapy-0.3.1.tar.gz (15.7 kB view hashes)

Uploaded Source

Built Distribution

kafkapy-0.3.1-py3-none-any.whl (19.9 kB view hashes)

Uploaded Python 3

Supported by

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