Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nextgencontributions/django2pydantic
Django2pydantic is the most complete library for converting Django ORM models to Pydantic models
https://github.com/nextgencontributions/django2pydantic
api api-rest converter django django-orm django-orm-crud inference models pydantic pydantic-v2 rest-api restapi restful-api schema
Last synced: 30 days ago
JSON representation
Django2pydantic is the most complete library for converting Django ORM models to Pydantic models
- Host: GitHub
- URL: https://github.com/nextgencontributions/django2pydantic
- Owner: NextGenContributions
- License: mit
- Created: 2024-10-27T15:36:09.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-29T15:10:31.000Z (about 1 month ago)
- Last Synced: 2024-11-29T16:23:11.146Z (about 1 month ago)
- Topics: api, api-rest, converter, django, django-orm, django-orm-crud, inference, models, pydantic, pydantic-v2, rest-api, restapi, restful-api, schema
- Language: Python
- Homepage:
- Size: 441 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
- Citation: CITATION.cff
Awesome Lists containing this project
README
![PyPI - License](https://img.shields.io/pypi/l/django)
![PyPI - Downloads](https://img.shields.io/pypi/dm/django2pydantic)# Why
django2pydantic is the most complete Pydantic schemas based on Django models.
# What
django2pydantic is a library that allows to define Pydantic schemas based on Django database models.
Similar libraries:
- [Djantic](https://jordaneremieff.github.io/djantic/)
- [Django Ninja Schema](https://django-ninja.dev/guides/response/django-pydantic/)
- [Ninja Schema](https://github.com/eadwinCode/ninja-schema)# Key features
- Supports all Django model field types
- Supports @property decorated Django model methods
- Supports all Django model relation fields:
- ForeignKey, OneToOneField, ManyToManyField
- The reverse relations of the above (ManyToOneRel, OneToOneRel, ManyToManyRel)
- Supports defining nested relations
- Provides as complete OpenAPI schema details as possible# How to use
[See usage example here.](examples.ipynb)