prance
Resolving Swagger/OpenAPI 2.0 and 3.0.0 Parser
What it is and what it does
Prance is a parser and validator for Swagger/OpenAPI specifications that handles both local file paths and remote URLs. It extends standard JSON reference resolution to work with OpenAPI's non-URI relative file paths, which standard JSON reference libraries do not support. The package provides two main parsing modes: ResolvingParser, which follows and resolves all JSON references into a flat specification dictionary, and BaseParser, which parses without resolving references.
The package includes a command-line interface for validating specs, compiling them into fully resolved output files, and converting older Swagger 2.0 specs to OpenAPI 3.0 format via an external web service. It depends on chardet, ruamel.yaml, requests, and packaging for core functionality, and delegates actual validation to pluggable backends (openapi-spec-validator, swagger-spec-validator, or flex) that you install separately.
Use it for:
- Validate and resolve Swagger/OpenAPI specs in CI/CD pipelines before deploying API services
- Parse OpenAPI specifications from files or URLs into Python dictionaries for code generation or documentation tools
- Compile multi-file API specs with external references into single resolved output files for distribution
- Convert legacy Swagger 2.0 definitions to OpenAPI 3.0 format programmatically
- Extract and flatten API specifications containing JSON references for analysis or transformation
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Prance parses and validates Swagger/OpenAPI 2.0 and 3.0 specifications in Python, resolving JSON references and external file paths according to the OpenAPI standard.
Yes, if you need to parse or validate OpenAPI/Swagger specs in Python. The package is actively maintained, has low install friction, and fills a real gap in reference resolution. Clarify the MITNFA license before use in proprietary contexts. Avoid the flex backend due to deprecated dependencies with known security issues.
Install
prance on PyPI
pip
pip install pranceuv
uv add prancepoetry
poetry add pranceInstalling prance
Before you install
Low friction install with a pure-wheel distribution. Active maintenance as of 2026-07-19 with recent releases. Requires Python 3.10 or later. Optional validation backends (openapi-spec-validator, swagger-spec-validator, flex) must be installed separately; flex is deprecated and carries security risks in its dependencies.
License in practice
License treatment is unclear (MITNFA). Verify the actual license terms before using in proprietary or restricted-license projects.
Quickstart
pip install prance
from prance import ResolvingParser
parser = ResolvingParser('path/to/swagger.yaml')
spec = parser.specification # fully resolved spec as dict
Requires Python 3.10 or later. A validation backend (openapi-spec-validator, swagger-spec-validator, or flex) must be installed separately for validation to work.
Verify before relying
- Whether MITNFA license is MIT-compatible or a custom variant requiring legal review
- Whether the package works correctly with all modern Python versions (3.10–3.14) despite Beta status
- Performance characteristics when resolving large or deeply nested specifications
Package facts
| License | MITNFA (unclear) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — chardet, ruamel.yaml, requests, packaging |
| Maintenance | actively maintained — 26 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,194,071/month — #1,959 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: prance-26.7.19.0-py3-none-any.whl
Keywords: swagger, openapi, parsing
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
openapi-spec-validatorValidates OpenAPI specifications (versions 2.0,…
permissive · top 1,000 on PyPI
swagger-spec-validatorValidates Swagger/OpenAPI specifications…
permissive · top 15,000 on PyPI
flexValidates Swagger 2.0 API specifications…
permissive · top 15,000 on PyPI
openapi3Parses and validates OpenAPI 3 specifications,…
permissive · top 15,000 on PyPI
openapi-schema-validatorValidates data and schemas against OpenAPI…
permissive · top 1,000 on PyPI
aiopenapi3Parses and validates OpenAPI 3 specifications…
permissive · top 15,000 on PyPI
drf-yasgGenerates Swagger/OpenAPI 2.0 specifications…
permissive · top 5,000 on PyPI
openapi-codecConverts between OpenAPI/Swagger schemas and…
permissive · top 15,000 on PyPI
referencingResolves JSON references according to JSON…
permissive · top 100 on PyPI
sceptre-file-resolverA Sceptre resolver plugin that retrieves file…
permissive · top 15,000 on PyPI