Skip to main content

kafka-schema-registry

This library allows you to create topics on Kafka topics, associated with a Confluent Schema Registry, and publish messages on them.

It takes care of:

  • creating the topic
  • publishing the associated schema (or updating an existing one)
  • serializing and publishing messages to Kafka

It works with kafka-python, and extra arguments are forwarded to it.

Installing

pip install kafka-schema-registry

Usage

from kafka_schema_registry import prepare_producer

SAMPLE_SCHEMA = {
    "type": "record",
    "name": "TestType",
    "fields" : [
        {"name": "age", "type": "int"},
        {"name": "name", "type": ["null", "string"]}
    ]
}


producer = prepare_producer(
        ['localhost:9092'],
        f'http://schemaregistry',
        topic_name,
        1,
        1,
        value_schema=SAMPLE_SCHEMA,
)

producer.send(topic_name, {'age': 34})
producer.send(topic_name, {'age': 9000, 'name': 'john'})

Running the tests

The test requires Docker in order to start a local Redpanda instance.

  • make start-redpanda to start the server
  • make test to configure a virtualenv and run the tests

Metadata

Release files for kafka-schema-registry 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kafka-schema-registry 0.1.2
File Size Uploaded Provenance Actions
kafka-schema-registry-0.1.2.tar.gz 5.4 kB Without provenance Details for kafka-schema-registry-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kafka-schema-registry 0.1.2
File Interpreter ABI Platform Actions
kafka_schema_registry-0.1.2-py3-none-any.whl Python 3 none any Details for kafka_schema_registry-0.1.2-py3-none-any.whl

Total release size: 11.2 kB

Release files / kafka-schema-registry-0.1.2.tar.gz

Download URL kafka-schema-registry-0.1.2.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9a68fe5aab6c69ceadc8399498ac2ff6582aec7fa53fb4af10f8722f0732882d
BLAKE2b-256 checksum
How to use checksums
2257096ebff00431d2b05ee1b9cff460c721a332564035abea223d60d91d9e9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.12.0 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5

Release files / kafka_schema_registry-0.1.2-py3-none-any.whl

Download URL kafka_schema_registry-0.1.2-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7bc1d2ec8ccdd8575d348d486d912ac7778b8b674b2a0c73b0709a8186ca48c4
BLAKE2b-256 checksum
How to use checksums
9b4fcb78b2cd975fe14357af1a78627b8e32e4d65c37261ed765a471744af545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.12.0 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5

Security for kafka-schema-registry 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page