primed-avro
version number: 0.0.6 author: Matthijs van der Kroon
Overview
A python package that provides:
- A basic Confluent Schema Registry client
- Confluent compatible Avro encoding and decoding
- High level KafkaConsumer that decodes Avro messages on the fly
WARNING: python2.7 not supported
Installation / Usage
To install use pip:
pip install primed_avro
Or clone the repo:
git clone https://gitlab.com/primedio/primed-avro
python setup.py install
Example Confluent Schema Registry client
from primed_avro.registry import ConfluentSchemaRegistryClient
csr = ConfluentSchemaRegistryClient(url="your_registry_url")
schemaMeta = csr.get_schema(subject=topic)
Example Avro en/decoding
from primed_avro.encoder import Encoder
from primed_avro.decoder import Decoder
encoder = Encoder(schema=schemaMeta.schema).get()
bytesvalue = encoder.encode(schemaMeta.id, record)
decoder = Decoder(schema=schemaMeta.schema).get()
record = decoder.decode(bytesvalue)
Example High level KafkaAvroConsumer
from primed_avro.consumer import AvroConsumer
c = AvroConsumer(
topic="mytopic",
bootstrap_servers="localhost:9092",
registry_url="http://localhost:8081"
)
for msg in c.consume():
print(type(msg), msg)
Contributing
TBD
Metadata
Release files for primed-avro 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| primed-avro-0.0.6.tar.gz | 5.8 kB | Details |
Release files / primed-avro-0.0.6.tar.gz
| Download URL | primed-avro-0.0.6.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7b8090533f7e7dc75bf8eec29565114c8c3816c3e6841778716690fca3e55821
|
|
BLAKE2b-256 checksum How to use checksums |
9cc8471cf3fca58bde8d698e00328f4a4775f817c27fbddfb21a590b6e83879e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.9.6
|