I think the package https://pypi.org/project/nonesafe/ does what you want, full disclosure I'm the author :). I had similar problems when processing external JSON data and had tried both Pandas and Pydantic, but was not happy with either solution. Take a look at the Motivation section of the README, in particular read/modify/write example at the end of the Motivation section.