
Pydantic coerces data to the type by default, converting strings like 25 to integers, while strict types model config or strict int enforce exact types and raise errors on casting.
Explore pedantic data types in Python, including date, time, and datetime from the typing module, to validate data in pydantic models.
Explore dictionaries and typed key-value structures in pedantic, annotate with dict vs typing dict, validate multi-level data, and implement nested models like product catalogs and order books.
Explore sets and tuples in python with pedantic typing, learning duplicate removal, type enforcement, and how fixed or variable length tuples model 3d coordinates and lists.
Build and inspect json schemas from Pydantic models to document, code generate, and create user interfaces, using the model json schema method and the json schema standard.
Convert serialized json data into model instances with the model validate json method, turning it into Python objects. Handle validation errors to distinguish valid users from invalid ones.
Cover building and deploying a fast API web app from scratch using pydantic models for polls and voters, with input validation, vote by label, results tracking, and Vercel serverless deployment.
Learn to implement a create poll instance method in pydantic that converts option strings into choice instances with incrementing labels, validates future expiration dates, and returns a new poll instance.
refactor validation errors into http exceptions with FastAPI to return json responses and status codes. enforce poll rules, 2–5 choices and future expiration, with 400 messages and 200 success.
Explore Redis as an in-memory key-value store for database, cache, and message broker. Learn open-source roots, data structures such as strings and streams, and a cloud-hosted durable Redis instance.
Define a votes router with post routes for vote by id and vote by label, reading poll id from path, using pydantic models, and integrate under /votes for swagger visibility.
Define a utility that converts a poll label into its corresponding choice uuid by fetching the poll and matching the label to a choice id.
Batch Redis calls with mget to fetch all poll jsons in one request, reduce RTT, and deserialize with a list comprehension using poll.model_validate_json.
Explore how to define a .gitignore to exclude environment variables, virtual environments, macOS system files, and Python bytecode, then initialize a local git repo and stage code for version control.
Create a private remote GitHub repository and push your existing local project from the command line, ensuring gitignore, main.py, and requirements.txt go to the remote before Vercel deployment.
Deploy the app to Vercel, configure environment variables from the dot env using load_dot_env, import the git repository, and verify the swagger docs at the polls API URL.
Explore basic and augmented arithmetic operators in Python, including +, -, *, /, +=, and **, plus modulo for even/odd checks and the rule of operator precedence.
Learn how for loops in Python iterate over iterables to execute a block of code for each item, print greetings, and understand iteration variables in lists and strings.
Learn the range in Python as an immutable sequence of integers with start, stop, and step. Use it in for loops; stop is exclusive, and range(n) defaults to start=0 and step=1.
Zip multiple Python iterables to create paired tuples from names and scores, see how to unpack these tuples for per-person output, and extend with attendance data.
Learn to define reusable Python functions to compute averages and apply them to lists, then enrich student records with average and past keys via a loop.
Welcome to the best resource online for learning modern Pydantic, a data validation library that has taken the python community by storm.
Pydantic is was first released in 2018 and has since become one of the most popular python libraries. It is nowadays downloaded more than 130 million times a month, and is used by some of the largest organizations out there, from the tech giants like Google, Amazon, Apple, Meta, and Netflix, to large conglomerates in various other industries, such as Starbucks, JPMorgan Chase. Oh, and yes, even NASA.
There's a good reason for this. Pydantic is a powerful library that elegantly solves a very common problem in software development: data validation.
Pydantic's speed, simple declarative syntax, and extensibility make it an indispensable utility in modern python development.
And in this course, you will learn everything you need to know to get started with Pydantic, from the very basics of defining data models, to more advanced topics such as fields with factory defaults, creating custom model-validators, data serialization, and much more.
The first part of the course will be purely about pydantic, where we explore it in isolation. You will learn:
how to define data models with pydantic
how to compose more complex models from simpler ones via inheritance
the foundations of type hinting in python, including enumerations, literals, and other advanced types-
how to use pydantic's powerful validation system
how to serialize and deserialize data
how to extract models to schemas
how to validate data against pydantic models
Then in the second part of the course we will turn our attention to the Capstone Project, where we will use pydantic to develop and deploy a python web API that allows users to create and vote on polls. This app will use Redis as our durable key-value data store, and will be deployed to production as a serverless function.
The Capstone will be developed step by step, in a series of about 30 skill challenges, where you will be asked to incrementally implement small features. This will give you the opportunity to practice what you've learned in the first part of the course, and to:
get a practical feel for how Pydantic is used in real-world applications
learn about modern API development with python
understand what Redis is and how it can be used as a durable data store
learn about virtual environments and dependency management in python
practice using git and github
learn the basics of serverless computing by deploying the API as a serverless function
The course will use the latest version of Pydantic, which leverages the power of Rust to achieve blazing fast performance.
Also, if you're new to python or haven't used the used the language in a while, there's a full-featured python crash course included as an extra appendix which will get you up to speed in no time.
I'm very excited to share this with you, and I look forward to seeing you in the course!