# tfranzel/drf-spectacular

Sane and flexible OpenAPI 3 schema generation for Django REST framework.

Repository: https://github.com/tfranzel/drf-spectacular
Canonical: https://ross.abutalabs.com/products/drf-spectacular
Homepage: https://drf-spectacular.readthedocs.io
Language: Python
License: BSD-3-Clause
License Family: permissive
Topics: rest-framework, openapi3, django, swagger, openapi-specification, documentation-generator, rest-api, drf, openapi-generator
Last push: 2026-08-21T19:33:04+00:00

## Health v2 (maintenance only)
Score: 85/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 60, longevity 100
- inputs: {"age_days": 2376, "days_push": 12, "days_rel": 58, "gap_med": 291.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2857, forks 329 (observed 2026-08-28T04:07:25.915140+00:00)

## What it is
drf-spectacular is a Python library that generates OpenAPI 3 (3.0, 3.1, and 3.2) schema specifications for Django REST framework APIs. It extracts as much schema information as possible from DRF serializers and views while offering extensive customization via decorators and hooks.

## Use cases
- generate an OpenAPI 3 schema for a Django REST framework API
- serve Swagger UI or Redoc documentation for a DRF API
- customize API schema with request and response serializer overrides
- document polymorphic responses in a DRF API
- produce client-ready OpenAPI specs for code generators
- add authentication schemes like SimpleJWT or OAuth to API docs

## When to choose
- you have a Django REST framework project and need accurate OpenAPI 3 documentation
- you want schema generation that handles nested, recursive, and polymorphic serializers
- you need fine-grained schema customization via decorators and hooks
- you want built-in Swagger UI and Redoc serving views

## When to avoid
- your API is not built on Django REST framework
- you need OpenAPI 2.0 (Swagger 2) output instead of OpenAPI 3
- you use a non-Python web framework

## Facets
- artifact type: library
- maturity: active
- function: api-documentation, documentation, serialization, middleware
- domain: web-development, backend, apis, documentation, developer-tools
- platform: python
- tags: django, django-rest-framework, openapi3, swagger, schema-generation, rest-api, api-docs, web-server

## Member repositories
- tfranzel/drf-spectacular (main) score 85

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:25.915140+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:36:30.617763+00:00, confidence not recorded.
  - readme: https://github.com/tfranzel/drf-spectacular (fetched 2026-08-28T04:07:25.915140+00:00, sha 3e73305f4ef9)
  - registry_pypi: https://pypi.org/pypi/drf-spectacular/json (fetched 2026-08-29T09:52:41.222228+00:00, sha 0c684af4045c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
