Pydantic V2 - Full Course - Learn the BEST Library for Data Validation and Parsing

Sdílet
Vložit
  • čas přidán 11. 07. 2024
  • Unlock the power of Pydantic V2 with this comprehensive course tailored for both beginners and seasoned developers. Dive deep into the world of data validation and parsing, and discover why Pydantic is one of the most influational Libraries in the Python Economy.
    Code: github.com/Coding-Crashkurse/...
    Timestamps
    Introduction: 0:00
    Basics: 0:34
    Nested models: 4:52
    Additional Parsers: 6:43
    Field Validators: 9:47
    Model Validators: 12:00
    The Field class: 15:30
    Computed Fields: 19:15
    Dataclasses with Pydantic: 20:57
    Strict Mode: 22:42
    Pydantic Settings: 24:09

Komentáře • 19

  • @julienstrebler4175
    @julienstrebler4175 Před dnem

    Hands down the best 30 minutes invested on Learning Python : Huge fan of your teaching method!

  • @mohammedhasibulhasan4668

    Very helpful. Thanks!

  • @mai6666
    @mai6666 Před 6 měsíci +5

    Finally there is someone who introduces pydantic v2

  • @paqstd-yt
    @paqstd-yt Před 3 měsíci +1

    Great video! Nothing superfluous, everything is clear. Good examples

  • @snsa_kscc
    @snsa_kscc Před 8 měsíci +7

    Coming from typescript ecosystem where I'm using packages like Zod to do basically the same things, it is nice to see python has this gem, too

  • @Dima-rj7bv
    @Dima-rj7bv Před 4 měsíci +1

    Extra thank-you for pydantic-settings!

  • @saurabhjain507
    @saurabhjain507 Před 8 měsíci +2

    Nice! Much needed walk through

  • @sunbath1024
    @sunbath1024 Před 7 měsíci

    Very nice video on Pydantic. Thanks you so much.

  • @matheussa8293
    @matheussa8293 Před 8 měsíci +1

    Thank you, it came at a great hour! I'm having problems, I'm creating an application that receives a dictionary from a request and then trying to convert it to a structure that the 'convert_pydantic_to_openai_function' method accepts, but it's difficult! Doing it statically by declaring it like: """class Tagging(BaseModel):
    title: str = Field(description="Write a title")
    ...""" and than using "convert_pydantic_to_openai_function(Tagging)
    Everything goes well, but when I try to convert the dictionary dynamically to fields such as 'title' mentioned, the problem arises, would you know how to do this conversion properly? So I could pass it on to AI dynamically to process the fields that the user provided in the request!

    • @codingcrashcourses8533
      @codingcrashcourses8533  Před 8 měsíci +2

      Ok that is an interested idea. I would probably try to create a class with no attributes attached. Allow extra_attributes and set these attributes AFTEr instantiation. May that be a solution?

  • @thelethalmoo
    @thelethalmoo Před 8 měsíci

    Ohh man i wish i knew about computed value already! Thats a life safer

  • @Jonathan-rm6kt
    @Jonathan-rm6kt Před 7 měsíci

    Thanks for the video. I’m currently very stuck on the concept of using multiple embeddings or vector indexes vs metadata / knowledge graph. My use case is simple: I have a text of a journal written roughly in chronological sequence. Embedding functions take into account the lexical meaning of words and their approx distance to each other, but not smart enough to allow something like “chapter 3 starts in 1872, so following day/month references like March 4, should have a closer cosine distance to 1827 than “March 4, 1824”.
    Is it possible to create a low dimensional embedding vector that represents sequence in the document or rough chronological distance to each other?
    I will pay $10 to anyone who is able to give me insight on this!

  • @chris_7711
    @chris_7711 Před 4 měsíci

    Validierung without Pydantic :D Language validation failed :D