skillfed

avro-gen

Avro record class and specific record reader generator

avro-gen v0.3.0 674.0K downloads/30d#5,393 on PyPI20
Permissive license License :: OSI Approved :: Apache Software License Abandoned released

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-gen

uv

uv add avro-gen

poetry

poetry add avro-gen

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6

Tags

avro schema code generatortyped avro records pythonavro class generatoravro schema to python classesavro record type hints
code-generatoravroabandoned

More Software Development packages