skillfed

avro-gen3

Avro record class and specific record reader generator

avro-gen3 v0.7.16 3.0M downloads/30d#2,800 on PyPI6
Permissive license License :: OSI Approved :: Apache Software License DORMANT released

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

uv

uv add avro-gen3

poetry

poetry add avro-gen3

Installing 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

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

Tags

avro schema code generatortyped avro records pythonavro class generatoravro schema to python classesavro datumreader wrapperavro type hintsavro protocol generator
code-generationavroschema-driven

More Software Development packages