I really like Pydantic because it makes it easy to define the the structure of the objects I want to use, using typing. I wanted to parse a json object and build a different object depending on the value of some specific key in the JSON object. Here, I have …