Web APIs in Python

11 projects in Web Development. Most starred: fastapi, grpcio and django-rest-framework.

FastAPI uses type hints and Pydantic models to validate requests, serialize responses and generate OpenAPI documentation automatically. It is async-first and built on Starlette. Inside Django, Django REST framework is the established toolkit, with serializers, viewsets, a browsable API and pluggable authentication and permissions. Django Ninja brings the FastAPI style of type-hinted endpoints and Pydantic schemas to Django, and django-modern-rest is a newer typed, async-capable option.

For Flask, Flask-RESTX adds resource classes and Swagger documentation, flask-smorest builds on marshmallow schemas to validate input and generate OpenAPI specs, and APIFlask wraps Flask with request validation and generated docs. Pick the one whose schema library matches what your project already uses. For a new API with no existing codebase, FastAPI or Django Ninja usually need the least code, because request validation and documentation both come from the same type hints, while Django REST framework is worth its extra ceremony when you want its permissions, throttling and generic views.

Beyond REST, Strawberry builds GraphQL schemas from type-annotated Python classes, with strawberry-django for Django models. Connexion is spec-first: you write the OpenAPI document and map its operations to Python functions. grpcio is the gRPC runtime for typed RPC between services over HTTP/2, with Protocol Buffers defining the contract. GraphQL fits clients that need to shape their own queries across related data, while gRPC fits internal service-to-service calls where both sides share generated code and you want strict schemas and streaming.

Django4

django-rest-framework

A powerful and flexible toolkit to build web APIs.

30.2kupdated 4d ago3.18.3

django-ninja

Fast, Django REST framework based on type hints and Pydantic.

9.2kupdated 4d ago1.7.1

strawberry-django

Strawberry GraphQL integration with Django.

504updated 1d ago0.93.0

django-modern-rest

Modern REST with speed, types, async, msgspec, pydantic and other goodies.

1.5kupdated today0.16.0

Flask3

flask-restx

Fully featured framework for fast, easy and documented API development with Flask.

2.2kupdated 6mo ago1.3.2

flask-smorest

A Flask/Marshmallow-based REST API framework with automatic OpenAPI documentation.

717updated 10d ago0.24.1

apiflask

A lightweight Python web API framework based on Flask, supporting marshmallow schemas and Pydantic models.

1.1kupdated 6d ago3.1.2

Framework Agnostic3

fastapi

A modern, fast, web framework for building APIs with standard Python type hints.

104.1kupdated today0.162.0

strawberry

A GraphQL library that leverages Python type annotations for schema definition.

4.7kupdated today0.336.2

connexion

A spec-first framework that handles requests based on your OpenAPI specification.

4.6kupdated 4d ago3.3.0

RPC1

grpcioC++ core

HTTP/2-based RPC framework with Python bindings, built by Google.

45.4kupdated 1d ago1.84.1
Esc

Type to search every entry. ↑↓ to move, Enter to open.