hydromodpy.schema#

Frontend hooks: JSON Schema export + partial field validator.

This sub-package exposes two stable integration points for external user interfaces (Angular, React, …). There is no HTTP server: the core stays pure Python. Consumers hit these helpers via the Python API or the hmp dev schema CLI and ship the resulting JSON over whatever transport they prefer.

Public API:

from hydromodpy.schema import export_full_schema, validate_field

export_full_schema("./schema/")
result = validate_field("flow.param_payload.Sy", 1.5)

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.

validate_field(path, value[, context, locale])

Validate value against the type of path in HydroModPyConfig.

Classes

ValidationResult(valid, path[, error, ...])

Outcome of validating a single configuration field.