All Projects → vitalik → Django Ninja

vitalik / Django Ninja

Licence: mit
💨 Fast, Async-ready, Openapi, type hints based framework for building APIs

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Ninja

Drf Yasg
Automated generation of real Swagger/OpenAPI 2.0 schemas from Django REST Framework code.
Stars: ✭ 2,523 (+188.34%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui, django
Swagger Ui
Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
Stars: ✭ 21,279 (+2331.89%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui
Flasgger
Easy OpenAPI specs and Swagger UI for your Flask API
Stars: ✭ 2,825 (+222.86%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui
Springdoc Openapi
Library for OpenAPI 3 with spring-boot
Stars: ✭ 1,113 (+27.2%)
Mutual labels:  rest-api, swagger, openapi, swagger-ui
Proteus
Lean, mean, and incredibly fast JVM framework for web and microservice development.
Stars: ✭ 178 (-79.66%)
Mutual labels:  rest-api, swagger, openapi
Swagger Express Middleware
Swagger 2.0 middlware and mocks for Express.js
Stars: ✭ 543 (-37.94%)
Mutual labels:  rest-api, swagger, openapi
Openapi Directory
🌐 Wikipedia for Web APIs. Directory of REST API definitions in OpenAPI 2.0/3.x format
Stars: ✭ 2,635 (+201.14%)
Mutual labels:  rest-api, swagger, openapi
Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+294.06%)
Mutual labels:  rest-api, swagger, openapi
Grpc Gateway
The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It reads protobuf service definitions and generates a reverse-proxy server which translates a RESTful HTTP API into gRPC. This server is generated according to the google.api.http annotations in your service definitions.
Stars: ✭ 12,223 (+1296.91%)
Mutual labels:  rest-api, swagger, openapi
Restrserve
R web API framework for building high-performance microservices and app backends
Stars: ✭ 207 (-76.34%)
Mutual labels:  rest-api, openapi, swagger-ui
Swagger Parser
Swagger 2.0 and OpenAPI 3.0 parser/validator
Stars: ✭ 710 (-18.86%)
Mutual labels:  rest-api, swagger, openapi
Swagger meqa
Auto generate and run tests using swagger/OpenAPI spec, no coding needed
Stars: ✭ 151 (-82.74%)
Mutual labels:  rest-api, swagger, openapi
Gemini
Model Driven REST framework to automatically generate CRUD APIs
Stars: ✭ 138 (-84.23%)
Mutual labels:  rest-api, swagger, openapi
Safrs
SqlAlchemy Flask-Restful Swagger Json:API OpenAPI
Stars: ✭ 255 (-70.86%)
Mutual labels:  rest-api, swagger, openapi
Drf Spectacular
Sane and flexible OpenAPI 3 schema generation for Django REST framework.
Stars: ✭ 414 (-52.69%)
Mutual labels:  rest-api, swagger, django
Tsed
📐 Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone.
Stars: ✭ 1,941 (+121.83%)
Mutual labels:  rest-api, swagger-ui, swagger
Oapi Codegen
Generate Go client and server boilerplate from OpenAPI 3 specifications
Stars: ✭ 806 (-7.89%)
Mutual labels:  rest-api, swagger, openapi
Flask Restplus Server Example
Real-life RESTful server example on Flask-RESTplus
Stars: ✭ 1,240 (+41.71%)
Mutual labels:  rest-api, swagger, openapi
Pretty Swag
Pretty UI for Swagger spec
Stars: ✭ 112 (-87.2%)
Mutual labels:  rest-api, swagger, swagger-ui
Php Crud Api
Single file PHP script that adds a REST API to a SQL database
Stars: ✭ 2,904 (+231.89%)
Mutual labels:  rest-api, swagger, openapi

Fast to learn, fast to code, fast to run

Test Coverage PyPI version

Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.

Key features:

  • Easy: Designed to be easy to use and intuitive.
  • FAST execution: Very high performance thanks to Pydantic and async support.
  • Fast to code: Type hints and automatic docs lets you focus only on business logic.
  • Standards-based: Based on the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
  • Django friendly: (obviously) has good integration with the Django core and ORM.
  • Production ready: Used by multiple companies on live projects (If you use django-ninja and would like to publish your feedback, please email [email protected]).

Django Ninja REST Framework

Documentation: https://django-ninja.rest-framework.com


Installation

pip install django-ninja

Usage

In your django project next to urls.py create new api.py file:

from ninja import NinjaAPI

api = NinjaAPI()


@api.get("/add")
def add(request, a: int, b: int):
    return {"result": a + b}

Now go to urls.py and add the following:

...
from .api import api

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", api.urls),  # <---------- !
]

That's it !

Now you've just created an API that:

  • receives an HTTP GET request at /api/add
  • takes, validates and type-casts GET parameters a and b
  • decodes the result to JSON
  • generates an OpenAPI schema for defined operation

Interactive API docs

Now go to http://127.0.0.1:8000/api/docs

You will see the automatic interactive API documentation (provided by Swagger UI):

Swagger UI

What next?

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].