Data validation and settings management using Python type hinting. Fast and extensible, pydantic plays nicely with your linters/IDE/brain. Define how data should be in pure, canonical Python 3.6+; validate it with pydantic. id is of type int; the annotation-only declaration tells pydantic that this field is required. Strings, bytes or floats will be coerced to ints if possible; otherwise an exception will be raised. name is inferred as a string from the provided default; because it has a default, it is not required. signup_ts is a datetime field which is not required (and takes the value None if it's not supplied). pydantic will process either a unix timestamp int (e.g. 1496498400) or a string representing the date & time. friends uses python's typing system, and requires a list of integers. As with id, integer-like objects will be converted to integers.

Features

  • Data validation and settings management using python type annotations
  • pydantic enforces type hints at runtime
  • Provides user friendly errors when data is invalid
  • Define how data should be in pure, canonical python
  • Plays nicely with your IDE/linter/brain
  • In benchmarks pydantic is faster than all other tested libraries

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow pydantic

pydantic Web Site

Other Useful Business Software
$300 in Free Credit Towards Top Cloud Services Icon
$300 in Free Credit Towards Top Cloud Services

Build VMs, containers, AI, databases, storage—all in one place.

Start your project in minutes. After credits run out, 20+ products include free monthly usage. Only pay when you're ready to scale.
Get Started
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pydantic!

Additional Project Details

Programming Language

Python

Related Categories

Python Integrated Development Environments (IDE)

Registered

2021-09-15