use pydantic
Might also be good use case for pydantic BaseSettings
class. --> https://pydantic-docs.helpmanual.io/usage/settings/
If you use pydantic.BaseModel you can make pydantic do the validation.
import pydantic
from typing import Optional
class Config(pydantic.BaseModel):
aoi: str
timestamp: datetime.date
some_optional_param: Optional[str]
Creating a config object using Config({timestamp: "2020-06-01"})
would throw an error because aoi
must be provided.
Since this class only holds data as far as I see, you could also turn this into dataclass to save some lines of code. Or use pydantic.BaseModel
if you want to add some validation of the parameters. https://pydantic-docs.helpmanual.io/usage/validators/
Processing class (and maybe others
/cc @christina