How Pydantic V2 Leverages Rust's Superpowers

June 02, 2023 46 min Free

Description

Pydantic is a data validation library for Python that has seen massive adoption over the last few years. This talk dives into how Pydantic V2 was rebuilt from the ground up using Rust for validation and serialization logic, and the advantages and disadvantages of writing libraries like Pydantic in Rust. Examples from the Pydantic V2 codebase demonstrate real-life trade-offs and design decisions when implementing logic in Rust rather than Python. This talk is suitable for Python developers interested in combining Python and Rust, requiring no prior knowledge of either.

Resources:
- Pydantic V2 Plan - blog post about the plan for Pydantic V2
- pydantic-core - the python package that provides Rust logic in pydantic
- PyO3 docs - the amazing library that allows Rust to be embedded in Python
- Build your Python Extensions with Rust! by Paul Ganssle - good intro to building Python extensions in Rust