avro-gen
Avro record class and specific record reader generator
What it is and what it does
Avro-gen is a code generator that transforms Avro schemas and protocols into typed Python record classes. Instead of working with plain dicts as the standard Avro library does, it produces concrete classes with properties, type hints, and IDE autocomplete for each field. The generator creates a module hierarchy that mirrors Avro namespaces, emitting a SchemaClasses root object with nested namespace and record classes, plus a SpecificDatumReader that deserializes Avro data into these typed instances rather than dicts.
The package supports logical types (date, time, timestamp, decimal) and allows registration of custom logical type processors. However, the project has been abandoned since early 2018, with no updates to support Python versions beyond 3.6, so it carries significant maintenance risk for modern codebases.
Use it for:
- Generate type-safe record classes from an Avro schema to enable IDE autocomplete and static type checking in Avro-based data pipelines.
- Build a typed data layer for services that read and write Avro records, replacing untyped dict manipulation with discoverable class properties.
- Organize Avro records by namespace into a Python module hierarchy for cleaner imports and namespace management in large schemas.
- Implement logical type support (dates, timestamps, decimals) on top of standard Avro by generating classes with proper type conversions.
- Validate schema structure at code-generation time rather than at runtime by inspecting generated class definitions.
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 and protocols, replacing dict-based Avro records with concrete classes that have IDE-discoverable type hints and schema validation.
No. The package is abandoned (last release 2018-01-13, last commit 2022-08-26) and explicitly targets Python 2.7, 3.5, and 3.6—all unsupported versions. Modern Python compatibility is unverified, install friction is high, and no maintainer is available for bug fixes or dependency updates. Consider a maintained alternative if you need typed Avro record generation.
Install
avro-gen on PyPI
pip
pip install avro-genuv
uv add avro-genpoetry
poetry add avro-genInstalling avro-gen
Before you install
High install friction from a source distribution. The package is abandoned—last release was 2018-01-13 and last commit 2022-08-26—so expect no maintenance, bug fixes, or compatibility updates.
License in practice
Apache License (permissive). You may use, modify, and distribute this code freely as long as you include the license notice and state significant changes.
Quickstart
from avrogen import write_schema_files
schema_json = '{"type": "record", "name": "example", "fields": [{"name": "id", "type": "long"}]}'
write_schema_files(schema_json, './output')
Classifiers list Python 2.7, 3.5, 3.6 only—compatibility with modern Python versions is unverified.
Verify before relying
- Whether this package works with Python versions beyond 3.6 (last release predates modern Python support).
- Whether the avro dependency version is pinned or compatible with current avro releases.
- Whether logical types support and custom type registration work as documented in practice.
Package facts
| License | License :: OSI Approved :: Apache Software License (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 3,135 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 674,009/month — #5,393 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: avro-gen-0.3.0.zip
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-gen3Generates typed Python record classes and a…
permissive · top 5,000 on PyPI
pydantic-avroConverts between pydantic class definitions and…
permissive · top 5,000 on PyPI
pandavroReads and writes Apache Avro files to and from…
permissive · top 15,000 on PyPI
fastavrofastavro reads and writes Apache Avro files…
permissive · top 1,000 on PyPI
dataclasses-avroschemaGenerates Avro schemas from Python dataclasses,…
permissive · top 5,000 on PyPI
avro-validatorValidates Python data against Avro schemas and…
permissive · top 15,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