Open Data Schema for Energy

Schema Validation

Schema validation enforces structural correctness for ODS-E records before they are used in analytics or reporting.

What Schema Validation Checks

Example

from odse import validate

result = validate({
    "timestamp": "2026-02-09T14:00:00Z",
    "kWh": 847.5,
    "error_type": "normal"
})

print(result.is_valid)
print(result.errors)

Typical Failure Categories

Category Example
Missing required field error_type absent
Type mismatch kWh provided as non-numeric string
Enum violation error_type: "degraded" (unsupported)
Format error non-ISO timestamp

Run schema validation immediately after transform and before persistence, aggregation, or model ingestion.