- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Pydantic - Nested Models, JSON Schema and Auto-Generating Models with datamodel-code-generator
In this video, we dive further into the Pydantic library in Python. This is based on the following blog post:
https://bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
We'll learn a number of things, including:
* How to define nested Pydantic models, forming parent-child relationships that allow us to model complex data that contains relationships.
* Using typing.Literal to constrain values on a field
* Defining default values for fields
* Generating JSON Schema from Pydantic models
* Auto-generating Pydantic models from JSON Schema definitions
Github data: https://github.com/bugbytes-io/datasets
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
03:47 Adding new Pydantic model for nested data
05:19 Adding a link to nested model in parent Pydantic class
07:38 The effect of the Union type on a Pydantic field
10:29 Constraining field values with Python Literal type
12:53 Adding custom validator function to check list length
15:05 JSON Schema outputs with Pydantic models
18:46 Auto-generating Pydantic models from JSON Schema with datamodel-code-generator
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
▶️ Full Playlist: https://youtube.com/playlist?list=PL-2EBeDYMIbT1M9S9PEFlqJ9SgFYYbIKp
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
👾 Github: https://github.com/bugbytes-io/datasets
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Pydantic Blog post: https://www.bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
Github Dataset: https://github.com/bugbytes-io/datasets
Pydantic Models: https://docs.pydantic.dev/usage/models/
Pydantic Validators: https://docs.pydantic.dev/usage/validators/
Pydantic Schema: https://docs.pydantic.dev/usage/schema/
JSON Schema: https://json-schema.org/
#python #pydantic #datascience
Видео Pydantic - Nested Models, JSON Schema and Auto-Generating Models with datamodel-code-generator канала BugBytes
https://bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
We'll learn a number of things, including:
* How to define nested Pydantic models, forming parent-child relationships that allow us to model complex data that contains relationships.
* Using typing.Literal to constrain values on a field
* Defining default values for fields
* Generating JSON Schema from Pydantic models
* Auto-generating Pydantic models from JSON Schema definitions
Github data: https://github.com/bugbytes-io/datasets
📌 𝗖𝗵𝗮𝗽𝘁𝗲𝗿𝘀:
00:00 Intro
03:47 Adding new Pydantic model for nested data
05:19 Adding a link to nested model in parent Pydantic class
07:38 The effect of the Union type on a Pydantic field
10:29 Constraining field values with Python Literal type
12:53 Adding custom validator function to check list length
15:05 JSON Schema outputs with Pydantic models
18:46 Auto-generating Pydantic models from JSON Schema with datamodel-code-generator
☕️ 𝗕𝘂𝘆 𝗺𝗲 𝗮 𝗰𝗼𝗳𝗳𝗲𝗲:
To support the channel and encourage new videos, please consider buying me a coffee here:
https://ko-fi.com/bugbytes
▶️ Full Playlist: https://youtube.com/playlist?list=PL-2EBeDYMIbT1M9S9PEFlqJ9SgFYYbIKp
𝗦𝗼𝗰𝗶𝗮𝗹 𝗠𝗲𝗱𝗶𝗮:
📖 Blog: https://bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
👾 Github: https://github.com/bugbytes-io/datasets
📚 𝗙𝘂𝗿𝘁𝗵𝗲𝗿 𝗿𝗲𝗮𝗱𝗶𝗻𝗴 𝗮𝗻𝗱 𝗶𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻:
Pydantic Blog post: https://www.bugbytes.io/posts/pydantic-nested-models-and-json-schemas/
Github Dataset: https://github.com/bugbytes-io/datasets
Pydantic Models: https://docs.pydantic.dev/usage/models/
Pydantic Validators: https://docs.pydantic.dev/usage/validators/
Pydantic Schema: https://docs.pydantic.dev/usage/schema/
JSON Schema: https://json-schema.org/
#python #pydantic #datascience
Видео Pydantic - Nested Models, JSON Schema and Auto-Generating Models with datamodel-code-generator канала BugBytes
Комментарии отсутствуют
Информация о видео
6 марта 2023 г. 15:14:39
00:24:40
Другие видео канала
