This repository contains the coveragejson-pydantic Python package. It provides Pydantic models for CoverageJSON. This can, for example, be used to develop an API using FastAPI serving or receiving CoverageJSON.
pip install covjson-pydantic
Or install from source:
pip install git+https://github.com/KNMI/covjson-pydantic.git
from covjson_pydantic import Domain
from covjson_pydantic import ValuesAxis
axis1 = ValuesAxis(values=[1.23])
d1 = Domain(
domainType="PointSeries",
axes={
"x": axis1,
"y": axis1,
"t": {"values": [2.0]}
}
)
print(d1.json())
See example.py
for more examples.
Make an editable install from within the repository root
pip install -e '.[test]'
pytest tests/
Apache License, Version 2.0
Koninklijk Nederlands Meteorologisch Instituut (KNMI)