apispec
A pluggable API specification generator. Currently supports the OpenAPI Specification (f.k.a. the Swagger specification).
Decision gist · record as of 2026-08-14
Yes. apispec is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and solves a real problem—keeping API documentation synchronized with code. The single dependency and low install friction make it a safe addition. Install it if you need OpenAPI specs for a Python web service and want to avoid manual YAML maintenance.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later.
- Low install friction with a single runtime dependency (packaging).
- Active maintenance with recent releases; last commit 2026-08-03 and 1218 GitHub stars indicate ongoing support.
License · maintenance · safety
permissive license (permissive) — MIT licensed under permissive terms, allowing free use, modification, and distribution with minimal restrictions.
last release 2026-03-06 (161 days) · last repo commit 2026-08-03 · 1,218 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 15,080,134 downloads/mo, #1,199 on PyPI
Alternatives
Verify before relying
pip install apispec
from apispec import APISpec
spec = APISpec(
title="My API",
version="1.0.0",
openapi_version="3.0.2"
)
print(spec.to_dict())- Whether the package supports automatic extraction of endpoint documentation from all major Python web frameworks beyond Flask
- Performance characteristics when generating specs for large APIs with hundreds of endpoints
- Extent of marshmallow schema inference capabilities and any limitations in complex nested structures
What it is and what it does
apispec is a code-driven OpenAPI specification generator that converts Python code into machine-readable API documentation. It works by introspecting your code—particularly route handlers, schemas, and security definitions—and synthesizing them into valid OpenAPI 2 or 3 documents that can be exported as JSON or YAML. The package is framework-agnostic at its core but ships with built-in support for marshmallow schema serialization, and integrates with web frameworks through optional plugins.
Typical usage involves instantiating an APISpec object with your target OpenAPI version, registering plugins for your framework and schema library, then feeding it your application's routes and models. It parses docstring annotations (YAML-formatted operation metadata) and automatically generates schema definitions, security schemes, and endpoint documentation. This keeps your spec in sync with your code rather than maintaining separate documentation files.
Use it for
- Generate interactive API documentation (Swagger UI, ReDoc) from Flask or other framework route definitions without manual YAML
- Maintain OpenAPI specs that stay synchronized with marshmallow schema changes during development
- Export API contracts for client code generation or third-party API integration testing
- Publish machine-readable API definitions for API gateways, monitoring tools, or developer portals
- Validate request/response schemas at runtime by embedding OpenAPI definitions in your application
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
apispec is production-stable (Development Status 5), actively maintained, has no known vulnerabilities, and solves a real problem—keeping API documentation synchronized with code. The single dependency and low install friction make it a safe addition. Install it if you need OpenAPI specs for a Python web service and want to avoid manual YAML maintenance.
Install
apispec on PyPI
Before you install
Low install friction with a single runtime dependency (packaging). Active maintenance with recent releases; last commit 2026-08-03 and 1218 GitHub stars indicate ongoing support.
Requires Python 3.10 or later.
License in practice
MIT licensed under permissive terms, allowing free use, modification, and distribution with minimal restrictions.
Quickstart
pip install apispec
from apispec import APISpec
spec = APISpec(
title="My API",
version="1.0.0",
openapi_version="3.0.2"
)
print(spec.to_dict())
Verify before relying
- Whether the package supports automatic extraction of endpoint documentation from all major Python web frameworks beyond Flask
- Performance characteristics when generating specs for large APIs with hundreds of endpoints
- Extent of marshmallow schema inference capabilities and any limitations in complex nested structures
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagepackaging |
| Maintenance | Actively maintained 161 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 15,080,134 / month, #1,199 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14 |
Evidence: apispec-6.10.0-py3-none-any.whl
Tags
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 spec generator”
- apispecGenerates OpenAPI specification documents from Python code,…
- openapi3Parses and validates OpenAPI 3 specifications, and provides a Python…
- openapi-generator-cliProvides a Python CLI wrapper for OpenAPI Generator, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Documentation packages
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
Sphinx generates professional documentation from reStructuredText source files, producing HTML, PDF, EPUB, and other formats with automatic cross-references, code highlighting, and hierarchical navigation.
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.
A Sphinx extension that outputs documentation in serialized HTML formats (JSON and pickle) alongside standard HTML.
Alabaster is a clean, responsive Sphinx theme for documentation that requires Python 3.10 or newer and Sphinx 6.2 or newer.
A Sphinx extension that generates HTML help files from reStructuredText documentation source.
See also apispec-webframeworks · flask-apispec · apispec-oneofschema · openapi-codec · marshmallow-jsonapi · bravado · pyral · aiopenapi3 · flasgger · bravado-core