My general rule is, if I have a dict with a fixed set of keys, it should be a dataclass. Problem solved!
Then if I need to send or receive it, it's an easy conversion to a Pydantic BaseModel.
Then if I need to send or receive it, it's an easy conversion to a Pydantic BaseModel.
It's really the way to go, takes a minute or two to define and saves so much headaches in the long run.
Or for JSON, dataclasses_json
If I want all the python-specific nuance on disk, I know I'm in a bad place!