Metadata-Version: 2.4
Name: overture-schema-validation
Version: 2.0.0
Summary: Validation helpers for the union of all discovered Overture models
License-Expression: MIT
Requires-Dist: overture-schema-common>=2.0.0
Requires-Dist: overture-schema-system>=2.0.0
Requires-Dist: pydantic>=2.12.0
Maintainer: Overture Maps Schema Working Group
Requires-Python: >=3.10
Project-URL: Homepage, https://overturemaps.org
Project-URL: Source, https://github.com/OvertureMaps/schema
Project-URL: Issues, https://github.com/OvertureMaps/schema/issues
Description-Content-Type: text/markdown

# overture-schema-validation

Validate data against the union of all discovered Overture Maps models.

This package provides `validate` and `validate_json`, which check a Python object or JSON document against every Overture model registered on the `overture.models` entry point and return the matching validated model instance.

## Installation

```bash
pip install overture-schema-validation
```

## Usage

```python
from overture.schema.validation import validate, validate_json

# A Python object -- the flat, tabular (Parquet-style) shape
feature = validate(feature_row)

# A JSON document -- GeoJSON
feature = validate_json(geojson_text)
```

The two entry points are not interchangeable. `validate` runs Pydantic's Python mode, which reads the flat column layout of the Parquet release -- the shape Overture publishes. `validate_json` runs JSON mode, which reads the GeoJSON representation the models support for compatibility with tools that expect features rather than rows. Handing a GeoJSON dict to `validate` reports `theme` and `version` missing and `type` set to `'Feature'`.

Both raise `pydantic.ValidationError` when the input matches no model. Which models participate is resolved at runtime by entry-point discovery, so installing additional Overture theme packages widens what these functions accept.
