$npx skillfedfor your agent

drf-yasg

Automated generation of real Swagger/OpenAPI 2.0 schemas from Django Rest Framework code.

Worth itPyPI DocumentationReleased Feb 20263.1M downloads / moBSD-3-ClausePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — drf_yasg-1.21.15-py3-none-any.whl
v1.21.15 · released 2026-02-24 · Python >=3.9 · 7 runtime deps: django, djangorestframework, inflection, packaging, pytz, pyyaml, uritemplate

Yes. drf-yasg is a mature, actively maintained tool for Django REST Framework projects that need Swagger/OpenAPI 2.0 documentation. Low install friction, no security issues, and permissive licensing make it a straightforward choice. The main caveat is that it targets OpenAPI 2.0, not 3.0; if you need OpenAPI 3.0 support, consider drf-spectacular instead. For existing DRF projects or new ones committed to OpenAPI 2.0, this is a reliable dependency.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Django and Django REST Framework installed; static files must be served (django.contrib.staticfiles required).
  • Low friction installation with a pure-Python wheel.
  • Actively maintained with a recent release; supports current Django (4.0–5.2) and Python (3.9–3.13) versions.

License · maintenance · safety

BSD-3-Clause (permissive) — BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and retain copyright notices.

last release 2026-02-24 (171 days) · last repo commit 2026-07-20 · 3,545 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 3,099,552 downloads/mo, #2,755 on PyPI

Verify before relying

pip install drf-yasg

# In settings.py
INSTALLED_APPS = ['django.contrib.staticfiles', 'drf_yasg', ...]

# In urls.py
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(title="API", default_version='v1'),
    public=True,
)
urlpatterns = [
    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]
  • Whether the package's OpenAPI 2.0 output is compatible with all code generation tools mentioned in the description.
  • Performance impact of schema generation on larger APIs beyond the caching mitigation described.
Same gist for agents: .md · .json

What it is and what it does

drf-yasg is a code-first API documentation tool for Django REST Framework that introspects your DRF views and serializers to generate a Swagger/OpenAPI 2.0 specification. It bundles swagger-ui and ReDoc viewers, so you get interactive documentation endpoints out of the box—no manual schema writing required. The generated specs can be served as JSON or YAML and are cacheable for performance.

The package handles nested serializers, response schemas, and model definitions compatible with code generation tools. It supports DRF's URLPathVersioning and NamespaceVersioning schemes. The documentation notes that OpenAPI 3.0 support is unlikely; for new projects targeting OpenAPI 3.0, the maintainers recommend drf-spectacular instead. Validation against the OpenAPI 2.0 spec is optional but can catch schema errors at generation time.

Use it for

  • Auto-generate interactive API documentation for a Django REST Framework service without writing YAML or JSON by hand.
  • Expose Swagger UI and ReDoc viewers at standard endpoints for API consumers to explore and test endpoints.
  • Generate OpenAPI 2.0 specs for code generation tools to produce client libraries in other languages.
  • Validate generated schemas against the OpenAPI 2.0 spec to catch structural errors early in development.
  • Cache the schema view to avoid regenerating specs on every request in production.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

drf-yasg is a mature, actively maintained tool for Django REST Framework projects that need Swagger/OpenAPI 2.0 documentation. Low install friction, no security issues, and permissive licensing make it a straightforward choice. The main caveat is that it targets OpenAPI 2.0, not 3.0; if you need OpenAPI 3.0 support, consider drf-spectacular instead. For existing DRF projects or new ones committed to OpenAPI 2.0, this is a reliable dependency.

Install

drf-yasg on PyPI

Before you install

Low friction installation with a pure-Python wheel. Actively maintained with a recent release; supports current Django (4.0–5.2) and Python (3.9–3.13) versions. No known vulnerabilities.

Requires Django and Django REST Framework installed; static files must be served (django.contrib.staticfiles required).

License in practice

BSD-3-Clause permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and retain copyright notices.

Quickstart

pip install drf-yasg

# In settings.py
INSTALLED_APPS = ['django.contrib.staticfiles', 'drf_yasg', ...]

# In urls.py
from drf_yasg.views import get_schema_view
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(title="API", default_version='v1'),
    public=True,
)
urlpatterns = [
    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
]

Verify before relying

  • Whether the package's OpenAPI 2.0 output is compatible with all code generation tools mentioned in the description.
  • Performance impact of schema generation on larger APIs beyond the caching mitigation described.

Package facts

LicenseBSD-3-Clause permissive
Python supportSupports the current Python release >=3.9
Install frictionLow. Pure-Python wheel
Runtime dependencies
7 packages
djangodjangorestframeworkinflectionpackagingpytzpyyamluritemplate
MaintenanceActively maintained 171 days since the last release
Last repo commit
First released
Downloads3,099,552 / month, #2,755 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.0Framework :: Django :: 4.1Framework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Intended Audience :: DevelopersOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9Topic :: DocumentationTopic :: Software Development :: Code Generators

Evidence: drf_yasg-1.21.15-py3-none-any.whl

Tags

Capabilities
swagger documentation generatoropenapi 2.0 schema djangodrf api documentationrest framework schema generationswagger ui for djangoapi specification from codeopenapi schema validator
Topics
api-documentationschema-generationswagger-openapi
PyPI keywords
codegendjangodjango-rest-frameworkdjango-rest-swaggerdocumentationdrfdrf-openapidrf-yasgopenapischemaswaggerswagger-codegen

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “openapi 2.0 schema django”

  • drf-yasgGenerates Swagger/OpenAPI 2.0 specifications automatically from…
  • flexValidates Swagger 2.0 API specifications against JSON Schema and…
  • drf-spectacularGenerates OpenAPI 3.0.3, 3.1, and 3.2 schemas automatically from…

Give your agent the search over MCP, or paste the wish link into any chat.

More Documentation packages

docutils With conditions
PyPI · Software Development · released May 2026

Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.

BSD-3-Clausepure Python · 3.9+
225.6Mdownloads / mo
Sphinx Worth it
PyPI · Software Development · released Dec 2025

Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.

BSD-2-Clausepure Python · 3.12+
91.8Mdownloads / mo
griffe Worth it
PyPI · Software Development · released Jun 2026

Griffe extracts the complete structure and signatures of Python programs to generate API documentation or detect breaking changes in your project's public API.

Install it if you need to programmatically inspect Python code structure, generate API docs, or enforce API stability in CI.

ISCpure Python · 3.10+
32.4Mdownloads / mo
sphinxcontrib-serializinghtml With conditions
PyPI · Utilities · released Jul 2024

A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.

BSD-3-Clausepure Python · 3.9+dormant
30.5Mdownloads / mo
alabaster Worth it
PyPI · Documentation · released Jul 2024

Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.

BSD-3-Clausepure Python · 3.10+dormant
30.4Mdownloads / mo
sphinxcontrib-htmlhelp With conditions
PyPI · Utilities · released Jul 2024

A Sphinx extension that generates HTML help files from reStructuredText documentation source.

BSD-3-Clausepure Python · 3.9+dormant
27.7Mdownloads / mo

See also django-rest-swagger · drf-spectacular · drf-spectacular-sidecar · bravado · flask-swagger · connexion · bravado-core · essentials-openapi · drf-spectacular-jsonapi · spectree