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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file kafkapy-0.3.1.tar.gz.

File metadata

  • Download URL: kafkapy-0.3.1.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for kafkapy-0.3.1.tar.gz
Algorithm Hash digest
SHA256 5fc19d2ab2b48c7b944ba41304791ef7aafe49024234a5074376afa881aa2d09
MD5 59bfb69778dae5f177f30b11109c3331
BLAKE2b-256 d6a1bf67408b252b1542d36492dea7c883f284b42687be4e53c62c33e4b58de5

See more details on using hashes here.

File details

Details for the file kafkapy-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: kafkapy-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 19.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.7.1 CPython/3.12.1 Linux/6.2.0-1018-azure

File hashes

Hashes for kafkapy-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bd13f156bc8c13c79bae6bb099a490f0746f622f24c0a207ca56e853dcef15a7
MD5 7117d696db89891879755c17d33670cf
BLAKE2b-256 381dbe29846c82cb54f4248783991f0140a5877fb420034cd4ccbef37bb54c61

See more details on using hashes here.

Supported by

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