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

Поделиться
HTML-код
  • Опубликовано: 27 янв 2025

Комментарии • 36

  • @mai6666
    @mai6666 Год назад +13

    Finally there is someone who introduces pydantic v2

  • @julienstrebler4175
    @julienstrebler4175 6 месяцев назад +3

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

  • @paqstd-yt
    @paqstd-yt 10 месяцев назад +1

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

  • @corrupted_handwritings
    @corrupted_handwritings 3 месяца назад

    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 Год назад +13

    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 3 месяца назад

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

  • @Dima-rj7bv
    @Dima-rj7bv 11 месяцев назад +1

    Extra thank-you for pydantic-settings!

  • @raphipik
    @raphipik Месяц назад

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

  • @waldoguy15
    @waldoguy15 13 дней назад

    Excellent overview

  • @garyr1639
    @garyr1639 4 месяца назад

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

  • @saurabhjain507
    @saurabhjain507 Год назад +2

    Nice! Much needed walk through

  • @yuriytimoshenkov9050
    @yuriytimoshenkov9050 2 месяца назад

    really enjoyed it, well explained

  • @mohammedhasibulhasan4668
    @mohammedhasibulhasan4668 6 месяцев назад +1

    Very helpful. Thanks!

  • @sunbath1024
    @sunbath1024 Год назад

    Very nice video on Pydantic. Thanks you so much.

  • @fljia8355
    @fljia8355 6 месяцев назад

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

  • @Алхимия-в9л
    @Алхимия-в9л 4 месяца назад

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

  • @NimaqAlizadeh
    @NimaqAlizadeh 4 месяца назад

    Nice🎉

  • @andreww2528
    @andreww2528 4 месяца назад

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

  • @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?

  • @riccardomenoli5185
    @riccardomenoli5185 5 месяцев назад

    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  5 месяцев назад +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 5 месяцев назад

      @@codingcrashcourses8533 Thank you so much!

  • @thelethalmoo
    @thelethalmoo Год назад

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

  • @dcldcl8054
    @dcldcl8054 3 месяца назад

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

  • @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!

  • @Qris_7711
    @Qris_7711 10 месяцев назад

    Validierung without Pydantic :D Language validation failed :D