Loading video player…

Using Pydantic to Simplify Python Data Validation (Overview)

Pydantic is a powerful data validation and settings management library for Python, engineered to enhance the robustness and reliability of your codebase. From basic tasks, such as checking whether a variable is an integer, to more complex tasks, like ensuring highly-nested dictionary keys and values have the correct data types, Pydantic can handle just about any data validation scenario with minimal boilerplate code.

In this video course, you’ll learn how to:

  • Work with data schemas with Pydantic’s BaseModel
  • Write custom validators for complex use cases
  • Validate function arguments with Pydantic’s @validate_call
  • Manage settings and configure applications with pydantic-settings
Download

Course Slides (.pdf)

7.3 MB
Download

Sample Code (.zip)

2.7 KB

00:00 Using Pydantic to Simplify Python Data Validation Pydantic is a powerful data validation and settings management library for Python engineered to enhance the robustness and reliability of your code. From basic tasks, such as checking whether a variable is an integer to more complex tasks, such as ensuring highly nested dictionary keys and values have the correct data types, Pydantic can handle just about any data validation scenario with minimal boilerplate code.

00:29 In this course, you’ll learn how to: work with data schemas, write custom validators for complex use cases,

00:37 validate function arguments, and manage settings and configure applications. Throughout this course, you’ll get hands-on examples of Pydantic’s functionality, and by the end, you’ll have a solid foundation for your own validation use cases.

00:51 Before starting this course, you’ll benefit from having an intermediate understanding of Python and object-oriented programming. And if you need to get up to speed, Real Python has you covered with this video course.

01:04 Any code that you see running in the REPL will be using the BPython interpreter. This is a replacement Python interpreter that offers a number of enhancements, including code highlighting and suggestions, but any code you see running on screen will work in the standard Python REPL, which is typically accessed by typing python or python3 at your terminal or command-line prompt.

01:25 Don’t forget to download the course materials as they include all the code that you’ll create in the course, which will make your learning experience easier.

01:33 So now you know what’s going to be covered, let’s get started.

Become a Member to join the conversation.