Kafkit API reference

kafkit.registry Package

Classes

Deserializer(*, registry)

An Avro message deserializer that understands the Confluent Wire Format and obtains schemas on-demand from a Confluent Schema Registry.

PolySerializer(*, registry)

An Avro message serializer that can write messages for multiple schemas in the Confluent Wire Format.

RegistryBadRequestError(status_code, *args)

An exception if the request is invalid (4XX errors).

RegistryBrokenError(status_code, *args[, …])

An excpetion if the server is down (5XX errors).

RegistryError

Base exception for Registry errors.

RegistryHttpError(status_code, *args[, …])

A base exception that includes metadata about the HTTP response.

RegistryRedirectionError(status_code, *args)

An exception for 3XX responses.

Serializer(*, schema, schema_id)

An Avro message serializer that writes in the Confluent Wire Format.

kafkit.registry.aiohttp Module

Aiohttp client for the Confluent Schema Registry.

This code and architecture is based on https://github.com/brettcannon/gidgethub See licenses/gidgethub.txt for info.

Classes

RegistryApi(*, session, url)

A Confluent Schema Registry client that uses aiohttp.

kafkit.registry.sansio Module

Code to help use the Confluent Schema Registry that is not specific to a particular http client library.

This code and architecture is inspired by https://github.com/brettcannon/gidgethub and https://sans-io.readthedocs.io. See licenses/gidgethub.txt for license info.

Functions

make_headers()

Make HTTP headers for the Confluent Schema Registry.

decipher_response(status_code, headers, body)

Process a response.

decode_body(content_type, body)

Decode an HTTP body based on the specified content type.

Classes

RegistryApi(*, url)

A baseclass for Confluent Schema Registry clients.

MockRegistryApi([url, status_code, headers, …])

A mock implementation of the RegistryApi client that doensn’t do network operations and provides attributes for introspection.

SchemaCache()

A cache of schemas that maintains a mapping of schemas and their IDs in a Schema Registry.

SubjectCache(schema_cache)

A cache of subjects in a schema registry that maps subject and version tuples to an actual schema.

kafkit.ssl Module

Support for connecting to brokers with SSL.

Functions

create_ssl_context(*, cluster_ca_path, …)

Create an SSL context for a client connecting to secured Kafka brokers.