Registry / aws / aws-glue-schema-registry

aws-glue-schema-registry

JSON →
library1.1.3pypypi✓ verified 83d ago

A Python library for integrating with AWS Glue Schema Registry, supporting Avro and JSON schemas. Version 1.1.3 is current; it requires Python >=3.8 and is under active development.

pip install aws-glue-schema-registry
INSTALL
IMPORT
SIG · AWS-GLUE-SCHEMA-RE
A
aws-glue-schema-registry
awspythonv1.1.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KafkaSerializer
from aws_schema_registry import KafkaSerializer
from aws_glue_schema_registry import GlueSchemaRegistry
KafkaDeserializer
from aws_schema_registry import KafkaDeserializer
from aws_glue_schema_registry import GlueSchemaRegistry
SchemaRegistryClient
from aws_schema_registry import SchemaRegistryClient
from aws_glue_schema_registry import GlueSchemaRegistry

Initialize a serializer for Avro schema and serialize a record.

import boto3 from aws_glue_schema_registry import GlueSchemaRegistry from aws_glue_schema_registry.serde.avro import AvroSerializer session = boto3.Session() glue_client = session.client('glue') registry_name = 'my-registry' schema_name = 'my-schema' # Schema definition (Avro example) avro_schema = { 'type': 'record', 'name': 'User', 'fields': [{'name': 'name', 'type': 'string'}] } serializer = AvroSerializer(glue_client, registry_name, schema_name, avro_schema) data = {'name': 'John'} serialized_bytes = serializer.serialize(data) print(serialized_bytes)
Debug
Known issues
gotchaThe library uses boto3's glue client directly; ensure that the IAM role/policy has glue:GetSchema, glue:PutSchemaVersion, glue:RegisterSchemaVersion permissions.
fix
Attach AWSGlueSchemaRegistryFullAccess policy or grant specific permissions.
affects: all
breakingVersion 1.0 changed the import path from aws_glue_schema_registry.serde to aws_glue_schema_registry.serde.avro and aws_glue_schema_registry.serde.json.
fix
Update imports to use the new submodules.
affects: <1.0
deprecatedThe 'serialize' method with positional arguments is deprecated in favor of keyword arguments.
fix
Use serializer.serialize(data=value) instead of serializer.serialize(value).
affects: >=1.1.0
Upgrade
Version history
1.1.3latest on PyPI · released Oct 17, 2023
Audit
Dependencies
boto3requiredAWS SDK for Python, required for AWS service interactions
fastavrorequiredAvro serialization/deserialization
jsonschemarequiredJSON schema validation
Agent activity
49 hits · last 30 days
node
43
OpenAI (training)
2
Resources
aws-glue-schema-registry — pip install aws-glue-schema-registry · libregistry