A highly useful library for data modeling, parsing and validation (used in FastAPI and useful for many other aspects of Python software development)
For Pydantic V2 see here: • Intro to Pydantic V1
00:00 - Introduction
02:16 - Basics
14:41 - Field Aliases
22:48 - Extra Fields Behavior
27:12 - Using Config for an Alias Generator
34:29 - Field Validations
35:02 - Field Validations - Constrained Numerics
36:14 - Field Validations - Constrained Strings
40:16 - Field Validations - Custom Validators
43:50 - Field Validations - Auto Correcting Field Values using Custom Validators
46:26 - Field Validations - Multi-Field Custom Validators
56:19 - Nested Models using Model Composition
You'll need to understand Python's type hinting syntax - if you're not familiar with that, I have a video on type hinting here: • Python Type Hinting
#mathbyteacademy #python #pydantic #pythonlibraries
Code for this Video
================
Available in GitHub code repo: https://github.com/fbaptiste/python-blog
Direct link: https://tinyurl.com/2mhxrv3u
My Python Courses
=================
Pydantic V2: Essentials
https://www.udemy.com/course/pydantic...
Python 3 Fundamentals (introduction to Python)
https://www.udemy.com/course/python3-...
Python 3 Deep Dive (Part 1 - Functional)
https://www.udemy.com/course/python-3...
Python 3 Deep Dive (Part 2 - Iteration, Generators)
https://www.udemy.com/course/python-3...
Python 3 Deep Dive (Part 3 - Hash Maps)
https://www.udemy.com/course/python-3...
Python 3 Deep Dive (Part 4 - OOP)
https://www.udemy.com/course/python-3...