Skip to main content

avdoc

CLI tool to generate human-readable HTML documentation for an Apache Avro schema AVSC file.

Want Avro schema docs? 'avdoc!

screenshot showing avdoc

Installation

Requirements

Software required outside of Python package dependencies:

Install as Python package

Install the avdoc package on PyPI:

pip install --upgrade avdoc

Usage

[python -m] avdoc tests/example.avsc > out/example.html && open out/example.html

To provide a version ID, e.g. the current git commit:

[python -m] avdoc --schema-version $(git rev-parse --short head) example.avsc > out/example.html

$ avdoc --help

usage: avdoc [-h] [--version] [--schema-title SCHEMA_TITLE]
             [--schema-version SCHEMA_VERSION]
             avsc

CLI tool to generate HTML documentation for an Apache Avro schema

positional arguments:
  avsc

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --schema-title SCHEMA_TITLE
  --schema-version SCHEMA_VERSION

Features

  • graph/diagram of which record schemas reference each other
    • reference graph for every complex (record) type
  • Markdown support in "doc" strings
  • supports all complex Avro types
    • record
    • enum
    • array
    • union
    • error
    • map
    • request

Design Goals

The output should:

  • be well-formatted semantic HTML.
  • be legible in basic browsers without styling.
  • aid understanding of the underlying schema.
  • be a single static file for sharing without dependencies.
  • be linkable to reference specific schemas and fields.

Development

  • devenv for development environment

devenv shell sets up Python with dependencies installed. This can be auto-activated with devenv auto-activation.

Publishing

Bump version

bumpversion major|minor|patch

Update documentation

Run mdsh.

Publish Python package to PyPI

Run uv publish and use PyPI token as password:

uv build && uv publish

Architecture

Not much to speak of.

avdoc is a couple of hundred lines of Python script generating static HTML, with a bit of string munging to get component outputs into the final HTML output page. This code is purpose-oriented. The output is opinionated, but not much time has been spent on the code past getting it working for my own needs. It's not intended to be exemplary of anything in particular.

Maintenance

I probably won't pay too much attention to avdoc maintenance once it's suitable for my own needs. I'd like to try to ensure that dependencies are kept up to date.

Fork for your own needs. Raise a PR if you'd like me to consider including your changes. Make sure you adhere to the license by ensuring your users have access to your modifications.

License

AGPL:

[…] requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version.

avdoc is released as copyleft software. If you modify avdoc then you must make changes available to your users.

If the AGPL license is an issue, and you want to relicense avdoc privately, then reach out to discuss pricing.

Prior Art

avdoc is intended as a replacement for avrodoc-plus, which itself was intended as a replacement for avrodoc, via a long line of forks.

To run avrodoc-plus and see its output:

npm install @mikaello/avrodoc-plus
node_modules/@mikaello/avrodoc-plus/bin/avrodoc-plus.js example.avsc --output out/avrodocplus.html

Why?

Unfortunately the original avrodoc and forks are all in varying stages of software decay, mostly due to NodeJS ecosystem churn. Their NPM package dependencies include packages which have themselves gone unmaintained or had breaking changes in following versions, with CVEs piling up against the transitive dependencies. avrodoc-plus has about 10 critical CVEs in its dependency graph. This isn't necessarily an issue in itself unless you're running these avrodoc tools in an online capacity or on untrusted input. But at $WORK it was generating a lot of false-positives in automatic SBOM security scanners which had to be explained to infosec specialists.

The HTML output from the avrodoc tools is also rather dynamic, requiring JS to render, when it could just be a classic HTML page.

I have taken the opportunity to implement some quality-of-life improvements for readers. See §Design Goals for more info.

Why the name avdoc specifically? The Apache Software Foundation protects project name trademarks (quite rightly) and I wanted to avoid the kcat naming issue.

avdoc is "Powered by Apache Avro™" but not a part of Apache Avro™.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avdoc-0.6.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avdoc-0.6.2-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file avdoc-0.6.2.tar.gz.

File metadata

  • Download URL: avdoc-0.6.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for avdoc-0.6.2.tar.gz
Algorithm Hash digest
SHA256 4b4e851dca2a7bbb5b9f8e9ac490a7bc8669f3e777b8678b3d69ccb53e2427d4
MD5 b2d6247dfd71516f135d806afec8d217
BLAKE2b-256 be0da13dd4c5aa575cb229f9ef1e435b3c5eca0fb42f7a82ed7268094439075b

See more details on using hashes here.

File details

Details for the file avdoc-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: avdoc-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for avdoc-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 87d7b4fd808d72c23345b40baa236739b3fb99897b451047222db176375db48f
MD5 2f358ca54d12569a58a6f430a3bf837b
BLAKE2b-256 1dccabd9d424c80f411af468356dfcf5b6bdf250925da13ca1ff9a2a542fc4a6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.0

2 files

0.6.4

2 files

0.6.3

2 files

This release

0.6.2 This release

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page