{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/12"}],"enrichment":{"capability":"Generates OpenAPI documents and validates HTTP requests and responses using Python type annotations with pydantic, supporting Flask, Quart, Falcon, and Starlette.","skillfed_tags":["openapi-generation","request-validation","api-documentation"],"use_cases":["Build REST APIs with automatic OpenAPI documentation by decorating endpoints with pydantic model validators.","Validate incoming query strings, JSON payloads, headers, and cookies against strict schemas without manual parsing.","Generate interactive API documentation (Swagger UI, Redoc, or Scalar) that stays in sync with your code.","Enforce response validation to catch serialization errors before they reach clients.","Define API security schemes (API keys, OAuth2) and enforce them per-endpoint or globally.","Skip boilerplate YAML configuration by deriving OpenAPI specs directly from Python type annotations."],"what_it_does":"SpecTree is a Python library that bridges type annotations and OpenAPI specification generation. It uses pydantic models to define request and response schemas, then automatically generates OpenAPI documents and serves them via interactive UI (Redoc, Swagger, or Scalar). The library works as a decorator-based validator that intercepts HTTP requests to your web application, validates query parameters, JSON bodies, headers, and cookies against your pydantic models, and validates responses before they're sent to clients.\n\nThe library is framework-agnostic at its core but provides integrations for Flask, Quart, Falcon, and Starlette. You define your data structures once as pydantic BaseModels, decorate your route handlers with @api.validate(), and SpecTree handles both validation and documentation generation. Failed validations return 422 status with structured error details. It supports security schemes (API keys, OAuth2), deprecated endpoints, tags, and custom response codes.","worth_installing":"Yes. SpecTree is actively maintained, has no known vulnerabilities, and installs with minimal friction. It solves a real problem\u2014keeping API documentation synchronized with code\u2014and does so without requiring separate YAML files. The single pydantic dependency is lightweight and widely used. It's most valuable if you're building REST APIs with one of the four supported frameworks and want automatic OpenAPI generation with request/response validation."},"id":"spectree","links":{"html":"https://skillfed.io/packages/spectree","md":"https://skillfed.io/packages/spectree.md","pypi":"https://pypi.org/project/spectree/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-12-16","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"spectree","python_support":"supports_current","summary":"Generate OpenAPI document and validate request & response with Python annotations."},"popularity":{"monthly_downloads":374170,"position":7148,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"2.0.1"}
