All Projects → samuelcolvin → Pydantic

samuelcolvin / Pydantic

Licence: mit
Data parsing and validation using Python type hints

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pydantic

prisma-client-py
Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
Stars: ✭ 739 (-91.16%)
Mutual labels:  python37, python38, pydantic, python39
hypercorn-fastapi-docker
Docker image with Hypercorn for FastAPI apps in Python 3.7, 3.8, 3.9. Ready for HTTP2 and HTTPS
Stars: ✭ 18 (-99.78%)
Mutual labels:  python37, python38, python39
Aioredis Py
asyncio (PEP 3156) Redis support
Stars: ✭ 2,003 (-76.05%)
Mutual labels:  python37, python38, python39
mcpyrate
Advanced macro expander and language lab for Python.
Stars: ✭ 35 (-99.58%)
Mutual labels:  python37, python38, python39
tukaan
A modern, cross platform Python toolkit for creating desktop GUI applications. Contributors are welcome!
Stars: ✭ 97 (-98.84%)
Mutual labels:  python37, python38, python39
docker-cgi-python
🐳Docker file for cgi using python2.7, 3.6, 3.7, 3.8, 3.9 and 3.10🐍
Stars: ✭ 13 (-99.84%)
Mutual labels:  python37, python38, python39
flake8-annotations
Flake8 Type Annotation Checking
Stars: ✭ 117 (-98.6%)
Mutual labels:  python37, python38, python39
pypackage
Cookiecutter python package using Poetry, mypy, black, isort, autoflake, pytest, mkdocs, and GitHub Actions
Stars: ✭ 12 (-99.86%)
Mutual labels:  python37, python38, pydantic
aioredis-cluster
Redis Cluster support extension for aioredis
Stars: ✭ 21 (-99.75%)
Mutual labels:  python37, python38, python39
json2object
Type safe Haxe/JSON (de)serializer
Stars: ✭ 54 (-99.35%)
Mutual labels:  parsing, json-schema
i18n-tag-schema
Generates a json schema for all i18n tagged template literals in your project
Stars: ✭ 15 (-99.82%)
Mutual labels:  validation, json-schema
svelte-form
JSON Schema form for Svelte v3
Stars: ✭ 47 (-99.44%)
Mutual labels:  validation, json-schema
statham-schema
Statham is a Python Model Parsing Library for JSON Schema.
Stars: ✭ 21 (-99.75%)
Mutual labels:  parsing, json-schema
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-99.68%)
Mutual labels:  validation, json-schema
openui5-validator
A library to validate OpenUI5 fields
Stars: ✭ 17 (-99.8%)
Mutual labels:  validation, json-schema
webargs-starlette
Declarative request parsing and validation for Starlette with webargs
Stars: ✭ 36 (-99.57%)
Mutual labels:  validation, parsing
mutatest
Python mutation testing: test your tests! Safely run mutation trials without source code modifications and see what will get past your test suite.
Stars: ✭ 50 (-99.4%)
Mutual labels:  python37, python38
openapi-schemas
JSON Schemas for every version of the OpenAPI Specification
Stars: ✭ 22 (-99.74%)
Mutual labels:  validation, json-schema
Malli
Data-Driven Schemas for Clojure/Script.
Stars: ✭ 667 (-92.02%)
Mutual labels:  json-schema, validation
apple-receipt
Apple InAppPurchase Receipt - Models, Parser, Validator
Stars: ✭ 25 (-99.7%)
Mutual labels:  validation, parsing

pydantic

CI Coverage pypi CondaForge downloads versions license

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.

Help

See documentation for more details.

Installation

Install using pip install -U pydantic or conda install pydantic -c conda-forge. For more installation options to make pydantic even faster, see the Install section in the documentation.

A Simple Example

from datetime import datetime
from typing import List, Optional
from pydantic import BaseModel

class User(BaseModel):
    id: int
    name = '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

Contributing

For guidance on setting up a development environment and how to make a contribution to pydantic, see Contributing to Pydantic.

Reporting a Security Vulnerability

See our security policy.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].