!!! note This post is a thought. It's a short note that I make about someone else's content online. Learn more about the process here

Here's my thought on 💭 Network Types - Pydantic

pydantic has a nice built in email validator EmailStr

It requires an optional pydantic dependency

pip install email-validator

Then you can validate email addresses.

from pydantic import BaseModel, EmailStr

class Model(BaseModel):
    email: EmailStr

print(Model(email='[email protected]'))
#> email='[email protected]'

This post was a thought by Waylon Walker see all my thoughts at https://waylonwalker.com/thoughts