Registry / web-framework / essentials-openapi

essentials-openapi

JSON →
library1.4.0pypypiunverified

Essentials OpenAPI is a Python library (current version 1.4.0) designed for generating OpenAPI Documentation in both v3 and v2 formats, with output capabilities in JSON and YAML. It also provides utilities for generating other types of documents from existing OpenAPI Specification files. The project is actively maintained with a regular release cadence, often addressing bug fixes and adding support for newer OpenAPI specification versions.

pip install essentials-openapi
INSTALL
IMPORT
SIG · ESSENTIALS-OPENAPI
E
essentials-openapi
web-frameworkpythonv1.4.0
Install
2.7s avg
Import
—
Disk
37MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 38MB
glibc
py 3.10–3.940 runs
installs and imports cleanly · install 2.7s · import 0.000s · 39MB
37MB installed
● package 37MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

OpenAPI
✓ from openapidocs import OpenAPI
✗ from openapidocs import OpenAPI

This quickstart demonstrates how to programmatically construct a minimal OpenAPI v3 specification using `essentials-openapi`. It defines API info, a basic path with a GET operation, and a response schema, then outputs the specification as JSON. This approach directly uses the library's Python classes to build the OpenAPI document structure.

from essentials_openapi.v3 import OpenAPI, Info, PathItem, Operation, Response, MediaType, Schema, Contact from essentials_openapi.v3.models import Reference # Define contact information contact_info = Contact(name='API Support', email='support@example.com') # Define basic API information info = Info( title='My Sample API', version='1.0.0', description='A simple API to demonstrate essentials-openapi.', contact=contact_info ) # Define a simple response schema success_schema = Schema(type='object', properties={'message': Schema(type='string')}) # Define a successful response success_response = Response( description='Successful operation', content={'application/json': MediaType(schema=Reference(ref='#/components/schemas/SuccessResponse'))} ) # Define an operation for a GET endpoint get_operation = Operation( summary='Get a greeting', responses={'200': success_response} ) # Define a path item path_item = PathItem(get=get_operation) # Create the OpenAPI object openapi = OpenAPI( info=info, paths={'/greet': path_item}, components={'schemas': {'SuccessResponse': success_schema}} ) # Generate the OpenAPI JSON output openapi_json = openapi.to_json(indent=2) print(openapi_json) # To save to a file (requires PyYAML for YAML, or built-in json for JSON) # with open('openapi.json', 'w') as f: # f.write(openapi_json)
Debug
Known issues
breakingAttempting to generate output artifacts from OpenAPI v2 (Swagger) specification files will now raise an error. The library's artifact generation features (e.g., via the 'oad gen-docs' CLI) exclusively support OpenAPI v3.x.
fix
Convert your Swagger (OpenAPI v2) specification to OpenAPI v3.x format before processing with `essentials-openapi`. Several online converters and tools are available for this purpose.
affects: >=1.4.0
deprecatedSupport for Python 3.8 was officially dropped with the release of version 1.1.0.
fix
Users running Python 3.8 or older must upgrade their Python environment to version 3.9 or newer to use `essentials-openapi` v1.1.0 and subsequent releases.
affects: >=1.1.0
gotcha`MarkupSafe` transitioned from a potentially optional/implicit dependency to a mandatory one.
fix
Ensure `MarkupSafe` is explicitly installed and up-to-date (`pip install --upgrade MarkupSafe`). Older versions of `MarkupSafe` (prior to 1.1.1) can cause `ImportError: cannot import name 'Feature' from 'setuptools'` with newer `setuptools`.
affects: >=1.0.9
gotchaThe library updated its internal representation to align with OpenAPI Specification v3.1.
fix
While OAS 3.1 is largely backward compatible with 3.0.x, users relying on very specific 3.0.x behaviors or tooling might encounter subtle differences. Review generated specs for compatibility with downstream tools if issues arise.
affects: >=1.2.0
Upgrade
Version history
1.4.0latest on PyPI · released Mar 7, 2026
Audit
Dependencies
pythonrequiredRequired Python version
MarkupSaferequiredRequired for rendering and escaping, became mandatory from v1.0.9.
PyYAMLrequiredRequired for YAML parsing and serialization.
pydanticoptionalEnables schema generation from Pydantic models (Pydantic v2+ support from v1.0.9), included with '[full]' extra.
Agent activity
25 hits · last 30 days
node
24
OpenAI (training)
1
Resources