Skip to main content

Data validation using Python type hints

Project description

Pydantic-QPython

This project is a branch of pydantic on QPython.

Data validation using Python type hints.

Fast and extensible, Pydantic plays nicely with your linters/IDE/brain. Define how data should be in pure, canonical Python 3.9+; validate it with Pydantic.

A Simple Example

from datetime import datetime
from typing import Optional
from pydantic import BaseModel

class User(BaseModel):
    id: int
    name: str = 'John Doe'
    signup_ts: Optional[datetime] = None
    friends: list[int] = []

external_data = {'id': '123', 'signup_ts': '2017-06-01 12:22', 'friends': [1, '2', b'3']}
user = User(**external_data)
print(user)
#> User id=123 name='John Doe' signup_ts=datetime.datetime(2017, 6, 1, 12, 22) friends=[1, 2, 3]
print(user.id)
#> 123

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydantic_qpython-2.9.2.1.tar.gz (361.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydantic_qpython-2.9.2.1-py3-none-any.whl (406.5 kB view details)

Uploaded Python 3

File details

Details for the file pydantic_qpython-2.9.2.1.tar.gz.

File metadata

  • Download URL: pydantic_qpython-2.9.2.1.tar.gz
  • Upload date:
  • Size: 361.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for pydantic_qpython-2.9.2.1.tar.gz
Algorithm Hash digest
SHA256 e4324c2bcb7ddee0556440864116f8d4f0fdb0800244f418134ba6f83c1cd2ae
MD5 026ca32d531a85d01a8f793b3084d9be
BLAKE2b-256 21976363a40a1a6e9cbd908fa080bb55671856f5b2be3e5978ca33fd1a555fb3

See more details on using hashes here.

File details

Details for the file pydantic_qpython-2.9.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pydantic_qpython-2.9.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7201d7d1e568b4a787addefc75ff87d87373c8a87501c52bd0918cd5da17721a
MD5 6b9007e767dcca90e54fa634f8857fd1
BLAKE2b-256 7bb082407b413e774aeb682b77dc012d31afed5a23c82275f952d43da78a57b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page