AvroCurio
Apache Avro serialization/deserialization with Confluent Schema Registry framing using Apicurio Schema Registry.
Installation
Using uv, poetry, or pip:
uv add avrocurio
poetry add avrocurio
pip install avrocurio
Quick Start
1. Define your schema using dataclasses-avroschema
from dataclasses import dataclass
from dataclasses_avroschema import AvroModel
@dataclass
class User(AvroModel):
name: str
age: int
email: str
2. Serialize and deserialize data
import asyncio
from avrocurio import AvroSerializer, ApicurioClient, ApicurioConfig
async def main():
# Configure connection to Apicurio Registry
config = ApicurioConfig(base_url="http://localhost:8080")
# Create client and serializer
async with ApicurioClient(config) as client:
serializer = AvroSerializer(client)
# Create a user instance
user = User(name="John Doe", age=30, email="john@example.com")
# Serialize the user to an Avro binary with Confluent registry framing.
# Under the hood this will perform a lookup against Apicurio to get the
# artifact ID for the schema, which is then prepended to the Avro binary
# (along with a magic byte).
serialized = await serializer.serialize(user)
# Deserialize the binary back to a User instance.
deserialized_user = await serializer.deserialize(serialized, User)
asyncio.run(main())
Confluent Schema Registry Wire Format
AvroCurio implements the Confluent Schema Registry wire format:
+----------------+------------------+------------------+
| Magic Byte | Schema ID | Avro Payload |
| (1 byte = 0x0) | (4 bytes, BE) | (remaining) |
+----------------+------------------+------------------+
- Magic Byte: Always
0x0to identify Confluent wire format - Schema ID: 4-byte big-endian integer referencing the schema in the registry
- Avro Payload: Standard Avro binary-encoded data
Schema Caching
Schema caching is handled automatically by the ApicurioClient for performance.
Development
Requirements
Integration tests require a running Apicurio Registry. Running it through Docker or Podman using Compose is easiest:
docker compose up
Port 8080 is assumed by default, but you can set APICURIO_URL to point to a different instance.
Running Tests
# Run all tests
uv run pytest
# Run specific test file
uv run pytest tests/test_serializer.py
# Run with verbose output
uv run pytest -v
# Skip integration tests
uv run pytest -m "not integration"
License
AvroCurio is open-source software released under the BSD-2-Clause Plus Patent License. This license is designed to provide: a) a simple permissive license; b) that is compatible with the GNU General Public License (GPL), version 2; and c) which also has an express patent grant included.
Please review the LICENSE file for the full text of the license.
Metadata
Release files for avrocurio 1.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| avrocurio-1.3.0.tar.gz | 89.4 kB | With provenance | Details for avrocurio-1.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| avrocurio-1.3.0-py3-none-any.whl | Python 3 | none | any | Details for avrocurio-1.3.0-py3-none-any.whl |
Total release size: 106.0 kB
Release files / avrocurio-1.3.0.tar.gz
| Download URL | avrocurio-1.3.0.tar.gz |
|---|---|
| Size | 89.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
049fe42b6de0be174869a590ba2c53f74b6e41a0b12a5afd2476af4ce65164b0
|
|
BLAKE2b-256 checksum How to use checksums |
73de15399608cd613df11e9a3e8d7b53cdcba5befdbe0347ddec7d5c44e23946
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.
Transparency logRelease files / avrocurio-1.3.0-py3-none-any.whl
| Download URL | avrocurio-1.3.0-py3-none-any.whl |
|---|---|
| Size | 16.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
822813df47f08c6ddfd61269122a9f7ba327a72fd344d6435ff8aeee2a135f7f
|
|
BLAKE2b-256 checksum How to use checksums |
6146666fc4773c8eb36148ae94d2af44fe72c5810e21621076550500518baef8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.
Transparency logSecurity for avrocurio 1.3.0
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for avrocurio-1.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 26, 2026.
Transparency logA 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.