--- id: avro-gen3 version: "0.7.16" license: License :: OSI Approved :: Apache Software License license_treatment: permissive maintenance: dormant --- # avro-gen3 — Avro record class and specific record reader generator License: permissive · Maintenance: dormant · Downloads: 3.0M/mo ## 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 above — 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 pip install avro-gen3 uv add avro-gen3 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 3.0M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags avro schema code generator, typed avro records python, avro class generator, avro schema to python classes, avro datumreader wrapper, avro type hints, avro protocol generator, code-generation, avro, schema-driven [View on SkillFed](https://skillfed.io/packages/avro-gen3) · [View on PyPI](https://pypi.org/project/avro-gen3/)