Samuel Colvin, Founder and Lead Maintainer of Pydantic

Samuel Colvin, Beyang Liu, Justin Dorfman

Pydantic is a Python library for typed validation of external data that has experienced exponential growth since 2020. We’ll hear the story of what motivated Samuel to create Pydantic, the most common ways people use it, and the success and growth of FastAPI with Pydantic. Also, Pydantic V2 has not been released yet, but we’ll learn what motivated Samuel to rewrite it in Rust, besides being faster and some other things happening with it. And if you’re interested, Samuel is always looking for contributors to Pydantic! Go ahead and download this episode now to hear more!


[00:00:59] Beyang gives us his understanding of what Pydantic does, and Samuel tells us two things that people appreciate about Pydantic.

[00:02:48] Samuel tells the story of what motivated him to create Pydantic, what the state of the world was at the time, and how it started.

[00:04:11] When Samuel first created Pydantic, he tells us if he had a particular use case in mind, and we hear the most common way people use Pydantic and other ways it’s used.

[00:05:46] Beyang is looking at the Pydantic docs and goes over an example of how you use the base model today. Samuel talks about the new Pydantic V2.

[00:07:23] We hear about Samuel's interaction with the FastAPI maintainers. Did he know them, and why does he think they selected Pydantic for their core piece of framework? Samuel mentions Django Ninja, which integrates Pydantic and Django, and Beyang mentions there are many highly starred cool projects using Pydantic and Django.

[00:11:53] The new version of Pydantic is written almost completely in Rust, so Samuel reveals why he decided to do the rewrite and what motivated him to use Rust.

[00:15:09] Beyang and Samuel discuss some of the Rust bindings so you can see what invoking Python from Rust looks like.

[00:21:03] The aspect of Pydantic, which is about translating from Python-type annotations into the core schema, Beyang wonders if that’s changing from Pydantic V1 to V2, and Samuel explains that it’s all rebuilt.

[00:24:03] Beyang wonders if anyone is using the not yet released Pydantic V2 yet. Samuel’s response: “I hope for nothing serious because it will change a lot!”

[00:24:40] A question in the chat came up for Samuel on Twitch: What motivated you to make the default behavior coercion rather than throwing an error?

[00:27:52] Will there be any changes to the public API from Pydantic V1 to V2? Samuel tells us there’s one thing that’s probably going to make people angry and he explains.

[00:29:33] Samuel gives an example of the output from serialization. Beyang wants to help Samuel out and tells him how Sourcegraph can potentially help him.

[00:34:25] There are some exciting things coming up for Pydantic that Samuel can’t announce quite yet, but he is excited about Pydantic V2 being released. Also, we hear they have GitHub sponsors, but another announcement about sponsors is coming soon.

[00:35:35] Samuel announces he would love for you to come and contribute to Pydantic.

Subscribe: YouTube Apple Spotify Google RSS

Start using Sourcegraph on your own code

Sourcegraph makes it easy to read, write, and fix code—even in big, complex codebases.