{"repo":"surenkov/django-pydantic-field","free":true,"listed":false,"github":"https://github.com/surenkov/django-pydantic-field","clone":"git clone https://github.com/surenkov/django-pydantic-field.git","description":"Type-Safe Pydantic Schemas for Django JSONFields","language":"Python","stars":218,"topics":["django","pydantic","jsonfield","schema"],"license":null,"category":"machine-learning","readme_excerpt":"Type-Safe Pydantic Schemas for Django JSONFields django-pydantic-field provides a way to use Pydantic models as schemas for Django's JSONField . It offers full support for Pydantic v1 and v2, type safety and integration with Django's ecosystem, including Forms and Django REST Framework. Highlights - Unified API : Transparent support for Pydantic v1 and v2 through the SchemaAdapter s. - Type-Safe : Support for static type checking (ty/mypy/pyright) with type inference for models and annotations. - Forward References : Lazy resolution of forward references, allowing schemas to be defined anywhere. - Django Integration : Support for Django Forms and the Admin interface. - DRF Support : Typed Serializers, Parsers, and Renderers with automatic OpenAPI schema generation via DRF's native schema generator. Installation Basic Usage The SchemaField can be used by passing the schema as the first argument (Django-like style) or by using type annotations. Supported Types Any type supported by Pydantic can be used as a schema: - pydantic.BaseModel and pydantic.RootModel (v2) - Standard Python types ( list[str] , dict[int, float] , etc.) - dataclasses.dataclass and TypedDict protocols - typing.Annotated with metadata. Forward References & Lazy Resolution SchemaField supports forward references via string literals or typing.ForwardRef . Resolution is deferred until the first time the field is accessed. Pydantic Version Support The package automatically detects the Pydantic version in your en","default_branch":null,"files":null,"tree":[],"storefront":"/r/surenkov","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/surenkov/django-pydantic-field/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}