Pydantic Tutorial β’ Solving Python's Biggest Problem
246,511
Published 2023-09-18
Pydantic is the most widely used data validation library for Python. It lets you structure your data, gives you type-hints and auto-complete in your IDE, and helps to serialize to and from JSON. Learn how to use it in just 10 minutes!
π Links
π Pydantic Docs: docs.pydantic.dev/
π Pydantic GitHub: github.com/samuelcolvin/pydantic
π Chapters
00:00 Python's Dynamic Typing Problem
02:11 How To Use Pydantic
05:04 Validating Data with Pydantic
06:36 Custom Field Validation
07:58 JSON Serialization
08:49 Pydantic vs Dataclasses
#pixegami #python
All Comments (21)
-
The explanation on the why and what problems Pydantic solves is one of the best that i have seen. I just had to subscribe!
-
You have a gift to explain complex things in a very simple to understand way.... great video Keep up the awesome work πͺ
-
Nice video,Β -not too big, not to short -presents the most popular points without sticking to details -compares to alternatives Thank you!
-
Best intro to pydantic I've seen so far. Thanks!
-
it's hilarious how many decades it took for python users to understand the benefit of strict typing
-
Excellent video. Thank you for getting straight to the point with clarity.
-
Coming from C++ and Rust, it's not that I want to work with Types, I kinda cannot work without them haha. So, that's the first topic I looked for when I had to do some stuff in Python. Well-made video, Mate. Thanks.
-
-
The pydantic model still does not do strict typechecking , for eg you can pass int to a class of pydantic model which accepts str , it'll typecast the int to str and pass the check. Although there is a solution which you can use , you can import StrictStr from pydantic for such cases
-
Crap! First 4 videos of yours I watch and they all solve real world problems I have been facing. Freak'n AWESOME! Thank you. FYI I'm coming from the Typescript world. Saves a lot of custom decorators we create.
-
Thanks for the hint and this will less stress me finding solutions to what you have explained. Keep it up you have a natural gift to explain in a way that anyone can understand
-
Very nice. Had been working with some parts of dataclasses in the past and used guard clauses instead of validators. Will try to use it in the future. Thank you
-
Absolutely precise and concise.
-
Wow, never understood that stuff until I watched this and it's pretty simple the way you explain it. Thanks...subbed!
-
A really nice explanation of the difference and use cases between the two modules, pydanic vs dataclasses. Well done.
-
very clear and concise, well organized, thanks.
-
Man, awesome content like I never saw before! Really, really good! Thank you!
-
Just wanted to say I love your video! Learned something new!
-
This is being improved upon in 3.12. I did not use it but I saw something about it in patch notes. I could be wrong but it is nice of Python to actually fix things if this is the case!
-
Very clear explanation - thanks for sharing !