PySTAC extension generator¶
pystac-ext-generator is a generic Python command-line application that turns a
STAC Extension JSON Schema into a standalone Python module containing
PySTAC-compatible extension classes.
The input schema determines the class name, registration URI, fields, types, and applicable STAC objects. Declared nested objects become additional value classes; Collection summary helpers are generated when the schema exposes summary fields. The generator is not tied to a particular extension or scientific domain.
pystac-ext-generator schema.json -o extension.py
Import the generated class from extension.py and use its ext() method to wrap
a PySTAC object. The generated module runs independently of the generator.
Embedded offline schema validation is available with --include-validation.
Start here¶
- Install the CLI.
- Generate and use your first extension.
- Work with generated fields and nested classes.
- Bundle external references.
- Look up CLI options or the Python API.
- Understand schema discovery and validation.
Python 3.10 or later is required. Lean modules such as Themes need only PySTAC.
Embedded validation and schema-dependent union decoding additionally need jsonschema;
wide factories use typing-extensions. Generated code never requires Click, Jinja2,
Ruff, or pystac-ext-generator.