Metadata-Version: 2.1
Name: kio
Version: 0.0.0a0
Summary: Python data types for the Apache Kafka® Protocol.
Author-email: Anton Agestam <anton.agestam@aiven.io>
License: Apache-2.0 license
Project-URL: Source Repository, https://github.com/Aiven-Open/kio
Project-URL: Bug Tracker, https://github.com/Aiven-Open/kio/issues
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Classifier: Topic :: Database
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8
License-File: LICENSE
License-File: NOTICE
Requires-Dist: typing-extensions>=4.6.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: pytest-icdiff; extra == "test"
Requires-Dist: pytest-random-order; extra == "test"
Requires-Dist: hypothesis>=6.61.0; extra == "test"
Requires-Dist: coverage; extra == "test"
Provides-Extra: codegen
Requires-Dist: pydantic<2,>=1.10.4; extra == "codegen"
Requires-Dist: requests; extra == "codegen"
Requires-Dist: pre-commit; extra == "codegen"
Provides-Extra: all
Requires-Dist: kio[test]; extra == "all"
Requires-Dist: kio[codegen]; extra == "all"

<h1 align=center>kio</h1>

<p align=center>
    <a href=https://github.com/aiven/kio/actions?query=workflow%3ACI+branch%3Amain><img src=https://github.com/aiven/kio/workflows/CI/badge.svg alt="CI Build Status"></a>
</p>

<p align=center>
    Python data types for the Apache Kafka® Protocol.
</p>

## Features

- Exposes immutable dataclass entities for all protocol messages, generated from the
  [same source][schema-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.

[schema-source]:
  https://github.com/apache/kafka/tree/trunk/clients/src/main/resources/common/message

## Development

Install development requirements.

```shell
$ python3 -m pip install -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.

```shell
$ docker compose --file=container/compose.yml up -d
```

Run tests.

```shell
$ python3 -X dev -m pytest --cov
```

Setup pre-commit to run on push.

```shell
$ pre-commit install -t pre-push
```

Fetch, generate, and format schema.

```shell
$ make build-schema
```
