In this video I show you how to use Pydantic V2, including topics such as default factories, custom serializers and custom validators. There is a whole lot more to Pydantic than what I can cover in a video such as this.
If you are interested in a deeper dive into Pydantic V2, please check out my Udemy course on the subject. Here is a discount coupon link (if it has expired, just let me know in the comments and I'll update it):
https://www.udemy.com/course/pydantic/?couponCode=PYDANTIC_YT_3
#pydantic #python
Content
=======
00:00 - Introduction
01:25 - Basic Models
07:28 - Validation Exceptions
09:56 - Deserializing Data
11:40 - Required vs Optional Fields
15:06 - Nullable Fields
22:20 - Aliases and the Field Class
25:42 - Serialization
27:21 - Field and Defaults
30:49 - Model Configuration - Populate by Name
33:11 - Mutable Defaults
35:01 - Default Factories
38:42 - Custom Serializers
48:56 - Custom Validators
1:02:32 - Nested Models
1:08:44 - Conclusion
Code for this Video
===================
Available in GitHub blog repo: https://github.com/fbaptiste/python-blog
Direct link: https://tinyurl.com/aantjwm5
My Python Courses
=================
- Python 3 Fundamentals (introduction to Python)
https://www.udemy.com/course/python3-fundamentals/?referralCode=DA09C6F40CEC38C942F6
- Pydantic V2: Essentials
https://www.udemy.com/course/pydantic/?referralCode=581AD0DC27E0E1EDB538
- Python 3 Deep Dive (Part 1 - Functional)
https://www.udemy.com/course/python-3-deep-dive-part-1/?referralCode=E46B931C71EE01845062
- Python 3 Deep Dive (Part 2 - Iteration, Generators)
https://www.udemy.com/course/python-3-deep-dive-part-2/?referralCode=3E7AFEF5174F04E5C8D4
- Python 3 Deep Dive (Part 3 - Hash Maps)
https://www.udemy.com/course/python-3-deep-dive-part-3/?referralCode=C5B0D9AB965B9BF4C49F
- Python 3 Deep Dive (Part 4 - OOP)
https://www.udemy.com/course/python-3-deep-dive-part-4/?referralCode=3BB758BE4C04FB983E6F