cedadev / stac-generator

Wrapper package to scan assets for metadata and facets to generate catalogue items. Provides IO packages
Other
3 stars 5 forks source link

Pydantic validator post extraction processor #48

Closed huard closed 2 years ago

huard commented 2 years ago

I believe this is similar to the vocab post_extraction_method, but instead of sending a request to an ontology service, it runs the properties through a user-defined pydantic data model, for example:

from pydantic import BaseModel
from typing import Literal

class CMIP5(BaseModel):
    experiment_id: Literal["rcp45", "rcp85"]
    frequency: Literal["amon", "day"]
huard commented 2 years ago

I just realized there is a PR (https://github.com/cedadev/asset-generator/pull/28) to run those post-extract processors. However, I tried to run with that branch and it didn't actually run the post-extract processor. See https://github.com/cedadev/asset-generator/pull/28/files#r906162959