hydromodpy.schema.export#

Full JSON Schema export for the HydroModPy configuration.

Produces three companion JSON files ready to be consumed by an external frontend that renders a formular without having to know anything about Python:

  • config.json - the full JSON Schema of HydroModPyConfig.

  • config_meta.json - high-level metadata (ordered root sections,

    UI groups, per-section titles).

  • field_validators.json - flat mapping field_path -> validator_type

    so the frontend can pick a widget + a local validator without re-parsing the schema.

The exporter reuses hydromodpy.config.schema_export for the raw Pydantic schema and adds the two companion documents on top.

Usage:

from hydromodpy.schema import export_full_schema

export_full_schema("./schema/")

CLI:

hmp schema export --output ./schema/

Functions

build_config_meta()

Return metadata describing the TOML layout (sections, order, groups).

build_field_validators()

Flatten every root-level field into a path -> validator_type map.

export_full_schema(output_dir, *[, indent])

Write the three companion JSON files into output_dir.