avro-gen3
Avro record class and specific record reader generator
What it is and what it does
Avro-gen3 is a code generator that converts Avro schemas and protocols into concrete Python record classes with type hints and IDE support. Instead of working with untyped dictionaries (as the standard Avro library does), it wraps the Avro DatumReader to return instances of generated classes with typed properties for each schema field. The generator creates a nested class hierarchy that mirrors Avro namespaces and produces submodules for clean imports.
The package handles logical types (date, time-millis, time-micros, timestamp-millis, timestamp-micros, decimal) out of the box and supports custom logical type processors. It generates both schema-based classes and protocol-based request types. Generated records behave as dictionaries internally, so they remain compatible with Avro's standard writers and readers, but provide schema discovery, validation, and autocomplete in your IDE.
Use it for:
- Generate strongly-typed Python classes from Avro schemas to catch field errors at development time rather than runtime.
- Build data pipelines where IDE autocomplete and type hints improve developer velocity when working with Avro records.
- Create protocol-based request/response classes for Avro RPC services with full type safety.
- Serialize and deserialize Avro data files while maintaining schema validation through generated reader classes.
- Support logical types in Avro records with automatic conversion to Python types like date and decimal.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates typed Python record classes and a reader from Avro schemas, replacing Avro's default dict-based approach with concrete classes that provide IDE type hints and schema validation.
Yes, with conditions. Install if you need typed Avro records with IDE support and are comfortable with a dormant package. The low install friction, permissive license, zero vulnerabilities, and top-5000 popularity make it reasonable for schema-driven workflows. However, verify compatibility with your Python version and test thoroughly before adopting in new projects, since maintenance appears stalled.
Install
avro-gen3 on PyPI
pip
pip install avro-gen3uv
uv add avro-gen3poetry
poetry add avro-gen3Installing avro-gen3
Before you install
Low friction: pure Python wheel with only two runtime dependencies (avro and six). Maintenance is dormant—last release was 708 days ago, though the repository remains active and has no known vulnerabilities.
License in practice
Apache License 2.0 (permissive): you can use, modify, and distribute this package freely in commercial and open-source projects, provided you include a copy of the license and note any changes.
Quickstart
pip install avro-gen3
from avrogen import write_schema_files
schema_json = '{"type": "record", "name": "example", "fields": [{"name": "id", "type": "long"}]}'
write_schema_files(schema_json, 'output_dir')
from avro import datafile, io
record_instance = record_class()
with open('file.avro', 'w+b') as f:
writer = datafile.DataFileWriter(f, io.DatumWriter(), schema)
writer.append(record_instance)
Verify before relying
- Whether the package works reliably with Python versions beyond 3.8 (classifiers list 3.5–3.8, but requires_python is unspecified)
- Current stability and real-world reliability given dormant maintenance status
- Whether generated classes fully integrate with avro and six without additional setup
Package facts
| License | License :: OSI Approved :: Apache Software License (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — avro, six |
| Maintenance | dormant — 708 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,988,152/month — #2,800 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: avro_gen3-0.7.16-py3-none-any.whl
Keywords: avro, class, generator
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
avro-genGenerates typed Python record classes and a…
permissive · top 15,000 on PyPI
avro-validatorValidates Python data against Avro schemas and…
permissive · top 15,000 on PyPI
pandavroReads and writes Apache Avro files to and from…
permissive · top 15,000 on PyPI
dataclasses-avroschemaGenerates Avro schemas from Python dataclasses,…
permissive · top 5,000 on PyPI
pydantic-avroConverts between pydantic class definitions and…
permissive · top 5,000 on PyPI
fastavrofastavro reads and writes Apache Avro files…
permissive · top 1,000 on PyPI
py-avro-schemaGenerates Apache Avro schemas from Python…
permissive · top 15,000 on PyPI
avro-python3Serializes and deserializes data in Apache Avro…
permissive · top 5,000 on PyPI
confluent_avroSerializes and deserializes Avro data according…
permissive · top 15,000 on PyPI
jschema-to-pythonGenerates Python class definitions from JSON…
permissive · top 5,000 on PyPI