Python data types for the Apache Kafka® Protocol.
Project description
kio
Python data types for the Apache Kafka® Protocol.
Features
- Exposes immutable dataclass entities for all protocol messages, generated from the same source as used internally in Apache Kafka®.
- Message classes are simply light-weight data containers and does not inherit anything or expose any methods other than a vanilla dataclass. Encoding and decoding is enabled by making all the necessary details about Kafka encoding introspectable.
- Supports encoding and decoding of messages through
IO[bytes]
. - Test suite with focus on roundtrip property tests using Hypothesis.
Installation
$ pip install --require-virtualenv kio
Development
Install development requirements.
$ pip install --require-virtualenv -e .[all]
The test suite contains integration tests that expects to be able to connect to an
Apache Kafka® instance running on 127.0.0.1:9092
. There is a Docker Compose file in
container/compose.yml
that you can use to conveniently start up an instance.
$ docker compose --file=container/compose.yml up -d
Run tests.
$ python3 -X dev -m pytest --cov
Setup pre-commit to run on push.
$ pre-commit install -t pre-push
[!WARNING]
Building the schema will delete thesrc/kio/schema
directory and recreate it again, hence all of the files under this directory will be deleted. Make sure to not put unrelated files there and accidentally wipe out your own work.
Fetch, generate, and format schema.
$ make build-schema
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file kio-0.0.0a2.tar.gz
.
File metadata
- Download URL: kio-0.0.0a2.tar.gz
- Upload date:
- Size: 109.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902bdd55c9c802ddda6065e6d3034432d91d2609479e57102757b364ecaa8acb |
|
MD5 | 9b2e9f08fc2d47946c1ded4547673a92 |
|
BLAKE2b-256 | c77036a8f430bfd29aa182d4099c3ae2128122caa9c77ebc3299f186f16e4a33 |
File details
Details for the file kio-0.0.0a2-py3-none-any.whl
.
File metadata
- Download URL: kio-0.0.0a2-py3-none-any.whl
- Upload date:
- Size: 617.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f779a6f6317904f5b7a546e322d50b99b061b1beae2da82731a8429937eb303b |
|
MD5 | dadb9b58b6d7137ecd9b7b4a1c00265d |
|
BLAKE2b-256 | 6301aad4d4ecf52b7c0ed79cf61ef3dce457ccfd22c780d54beaa7823b7cce47 |