Quickly learn to use Pydantic to parse JSON data from a file or API. In just 5 minutes, you'll see how to take invalid data in JSON format, model it with Pydantic classes we create, and automatically detect errors and convert data to valid inputs when possible.
Enjoy this Python short "quick hit" video by Michael Kennedy, a Python Software Fellow and host of the Talk Python To Me podcast.
▬ CODE ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Get the code for this video, and all my shorts, at https://talkpython.fm/shorts-code
▬ Chapters ▬▬▬▬▬▬▬▬▬▬▬▬
0:00 - Introduction
0:21 - Your job: API developer
0:50 - What is Pydantic?
1:05 - The data we get with our "api"
2:17 - Modeling the data with classes
3:34 - Installing Pydantic
4:14 - Passing data to our Pydantic models
4:35 - Catching invalid data with Pydantic
5:20 - Seeing the validated and converted model result
7:08 - Conclusion
▬ More Videos ▬▬▬▬▬▬▬▬▬▬▬▬
Subscribe to the Python Shorts playlist by Michael at https://talkpython.fm/python-shorts to see all the topics we've covered.
▬ Dive deeper ▬▬▬▬▬▬▬▬▬▬▬▬
Listen to the Talk Python To Me podcast at https://talkpython.fm
Check out our 100's of hours of Python courses at https://training.talkpython.fm/course...
Follow Michael on Twitter at / mkennedy
Watch video Parsing data with Pydantic - A Python short by Michael Kennedy online without registration, duration hours minute second in high quality. This video was added by user Michael Kennedy 13 January 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 25,23 once and liked it 1 thousand people.