Pydantic - Type Hints For Validating Data

28 views
Skip to first unread message

Thomas Passin

unread,
Apr 10, 2023, 9:06:02 AM4/10/23
to leo-editor
I just learned of the Pydantic  project.  It uses Python's type hints to validate structured data at the point of use.  It sounds interesting.

"Data validation and settings management using Python type annotations.

pydantic enforces type hints at runtime, and provides user friendly errors when data is invalid.

Define how data should be in pure, canonical Python; validate it with pydantic."



Edward K. Ream

unread,
Apr 10, 2023, 10:51:55 AM4/10/23
to leo-e...@googlegroups.com
On Mon, Apr 10, 2023 at 8:06 AM Thomas Passin <tbp1...@gmail.com> wrote:
I just learned of the Pydantic  project.  It uses Python's type hints to validate structured data at the point of use.  It sounds interesting.

Thanks for the link.

Edward

David Szent-Györgyi

unread,
Apr 16, 2023, 12:03:59 AM4/16/23
to leo-editor
It does sound interesting. It even supports "custom" (user-defined) types. 

A plug-in for Pydantic supports Hypothesis, «a Python library for creating unit tests which are simpler to write and more powerful when run, finding edge cases in your code you wouldn’t have thought to look for. It is stable, powerful and easy to add to any existing test suite. It works by letting you write tests that assert that something should be true for every case, not just the ones you happen to think of.»
Reply all
Reply to author
Forward
0 new messages