Telegram Group & Telegram Channel
Валидация данных с Pydantic

Pydantic — это библиотека для парсинга и валидации данных, в котором атрибуты класса имеют статическую типизацию. 

Эта типизация используется в момент создания обьекта класса для проверки значений.

Пакет хорош в ситуациях когда вам нужно распарсить какой-то json, и все это превращается в рутину: проверка структуры json, необходимых полей, значений и так далее. 

Также имеется поддержка множества других типов данных, помимо стандартных, таких как почта, url адрес, номер платежных карт.
 
Полноценный пример есть на картинке выше. Документация находится здесь.

#pydantic



tg-me.com/python_academy/740
Create:
Last Update:

Валидация данных с Pydantic

Pydantic — это библиотека для парсинга и валидации данных, в котором атрибуты класса имеют статическую типизацию. 

Эта типизация используется в момент создания обьекта класса для проверки значений.

Пакет хорош в ситуациях когда вам нужно распарсить какой-то json, и все это превращается в рутину: проверка структуры json, необходимых полей, значений и так далее. 

Также имеется поддержка множества других типов данных, помимо стандартных, таких как почта, url адрес, номер платежных карт.
 
Полноценный пример есть на картинке выше. Документация находится здесь.

#pydantic

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/740

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

How Does Bitcoin Work?

Bitcoin is built on a distributed digital record called a blockchain. As the name implies, blockchain is a linked body of data, made up of units called blocks that contain information about each and every transaction, including date and time, total value, buyer and seller, and a unique identifying code for each exchange. Entries are strung together in chronological order, creating a digital chain of blocks. “Once a block is added to the blockchain, it becomes accessible to anyone who wishes to view it, acting as a public ledger of cryptocurrency transactions,” says Stacey Harris, consultant for Pelicoin, a network of cryptocurrency ATMs. Blockchain is decentralized, which means it’s not controlled by any one organization. “It’s like a Google Doc that anyone can work on,” says Buchi Okoro, CEO and co-founder of African cryptocurrency exchange Quidax. “Nobody owns it, but anyone who has a link can contribute to it. And as different people update it, your copy also gets updated.”

Among the actives, Ascendas REIT sank 0.64 percent, while CapitaLand Integrated Commercial Trust plummeted 1.42 percent, City Developments plunged 1.12 percent, Dairy Farm International tumbled 0.86 percent, DBS Group skidded 0.68 percent, Genting Singapore retreated 0.67 percent, Hongkong Land climbed 1.30 percent, Mapletree Commercial Trust lost 0.47 percent, Mapletree Logistics Trust tanked 0.95 percent, Oversea-Chinese Banking Corporation dropped 0.61 percent, SATS rose 0.24 percent, SembCorp Industries shed 0.54 percent, Singapore Airlines surrendered 0.79 percent, Singapore Exchange slid 0.30 percent, Singapore Press Holdings declined 1.03 percent, Singapore Technologies Engineering dipped 0.26 percent, SingTel advanced 0.81 percent, United Overseas Bank fell 0.39 percent, Wilmar International eased 0.24 percent, Yangzijiang Shipbuilding jumped 1.42 percent and Keppel Corp, Thai Beverage, CapitaLand and Comfort DelGro were unchanged.

Python Academy from es


Telegram Python Academy
FROM USA