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

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ม.ค. 2025

ความคิดเห็น •

  • @mai6666
    @mai6666 ปีที่แล้ว +11

    Finally there is someone who introduces pydantic v2

  • @paqstd-yt
    @paqstd-yt 9 หลายเดือนก่อน +1

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

  • @julienstrebler4175
    @julienstrebler4175 5 หลายเดือนก่อน +2

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

  • @raphipik
    @raphipik 15 วันที่ผ่านมา

    Awesome tutorial! Got me up to speed with a library that's using a lot of pydantic that Im trying to understand. Thank you :)

  • @corrupted_handwritings
    @corrupted_handwritings 2 หลายเดือนก่อน

    Thanks man, you covered basically everything you need to know to get started, undoubtedly the best pydantic course i've seen on youtube

  • @snsa_kscc
    @snsa_kscc ปีที่แล้ว +12

    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

    • @Cithulu1
      @Cithulu1 2 หลายเดือนก่อน

      and don't forget pandera for runtime validation on dataframes. nice to see python gaining type support in multiple areas.

  • @garyr1639
    @garyr1639 3 หลายเดือนก่อน

    Well done, this is an excellent demonstration of the uses of Pydantic.

  • @Dima-rj7bv
    @Dima-rj7bv 10 หลายเดือนก่อน +1

    Extra thank-you for pydantic-settings!

  • @yuriytimoshenkov9050
    @yuriytimoshenkov9050 หลายเดือนก่อน

    really enjoyed it, well explained

  • @saurabhjain507
    @saurabhjain507 ปีที่แล้ว +2

    Nice! Much needed walk through

  • @mohammedhasibulhasan4668
    @mohammedhasibulhasan4668 5 หลายเดือนก่อน +1

    Very helpful. Thanks!

  • @fljia8355
    @fljia8355 5 หลายเดือนก่อน

    at 20:39, the @computed_field has been removed above "def age()" function?

  • @sunbath1024
    @sunbath1024 ปีที่แล้ว

    Very nice video on Pydantic. Thanks you so much.

  • @Алхимия-в9л
    @Алхимия-в9л 3 หลายเดือนก่อน

    Hello. Thanks for video. Last operation with use env_file, env variables loads not from firle), from enviroment?

  • @andreww2528
    @andreww2528 4 หลายเดือนก่อน

    Is there anything specific that makes this the best library versus standard librarys dataclasses or the attrs library?

    • @codingcrashcourses8533
      @codingcrashcourses8533  4 หลายเดือนก่อน

      Come on, I explain that in the first 20 seconds of this Video 😅

  • @riccardomenoli5185
    @riccardomenoli5185 4 หลายเดือนก่อน

    As far as I see pydantic kind of kills the __init__ method. When I define classes I do not need to use anymore the __init__ method but the pytdantic attributes. Is it correct?

    • @codingcrashcourses8533
      @codingcrashcourses8533  4 หลายเดือนก่อน +1

      Yes, you are correct to some extent, but let's clarify the details.
      When using Pydantic to define data models in Python, it automatically generates the __init__ method for you, based on the fields you define in the class. This means that you generally don't need to write a custom __init__ method yourself because Pydantic handles the initialization of the attributes, as well as validation and type checking.

    • @riccardomenoli5185
      @riccardomenoli5185 4 หลายเดือนก่อน

      @@codingcrashcourses8533 Thank you so much!

  • @matheussa8293
    @matheussa8293 ปีที่แล้ว +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  ปีที่แล้ว +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?

  • @NimaqAlizadeh
    @NimaqAlizadeh 4 หลายเดือนก่อน

    Nice🎉

  • @dcldcl8054
    @dcldcl8054 2 หลายเดือนก่อน

    But wait. Your Food object in your instance of the Restaurant class in not a Food obj but a dictionary.

  • @thelethalmoo
    @thelethalmoo ปีที่แล้ว

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

  • @Jaybearno
    @Jaybearno ปีที่แล้ว

    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!

    • @codingcrashcourses8533
      @codingcrashcourses8533  ปีที่แล้ว

      I would try to have a look if SelfQueryRetrievers, if you use Langchain

  • @Qris_7711
    @Qris_7711 9 หลายเดือนก่อน

    Validierung without Pydantic :D Language validation failed :D