fastspec
Dynamic OpenAPI, Discovery, and GraphQL spec client for Python — turn any API spec into a fully-typed async client with attribute chaining, streaming, and file uploads
What it is and what it does
fastspec is a client generator that reads OpenAPI (JSON/YAML) or Google Discovery API specifications and automatically builds a fully async Python client. Instead of hand-writing HTTP calls or maintaining generated code, you load a spec, instantiate a client with auth headers, and call endpoints using attribute chaining—the library handles parameter validation, serialization, streaming, and file uploads transparently.
The package is built on fastcore and fasttransport, providing a lightweight async foundation. It's designed for developers who work with multiple APIs and want to avoid boilerplate; the same pattern works across any spec-compliant API. Operations are discovered at runtime and organized into logical groups, so you can explore available endpoints programmatically.
Use it for:
- Build a unified async client for LLM APIs without hand-writing request code.
- Quickly prototype integrations with REST APIs using their published specs.
- Stream responses from APIs that support streaming with a single flag.
- Upload files to APIs while keeping the client code simple and type-aware.
- Dynamically generate clients for internal or third-party APIs when specs are available.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Converts OpenAPI and Google Discovery API specs into fully async Python clients with attribute chaining, streaming, and file upload support.
Yes, if you work with multiple spec-compliant APIs and want to eliminate boilerplate client code. The low install friction, active maintenance, permissive Apache-2.0 license, and no known vulnerabilities make it a safe choice. The async-first design and support for streaming and file uploads cover real API patterns. Start with it if you're building integrations with services that publish OpenAPI or Google Discovery specs.
Install
fastspec on PyPI
pip
pip install fastspecuv
uv add fastspecpoetry
poetry add fastspecInstalling fastspec
Before you install
Low install friction with a pure Python wheel. Active maintenance with a recent release on 2026-08-13; the repository shows current activity.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install fastspec
from fastspec.oapi import OpenAPIClient
from fastspec.spec import SpecParser
spec = SpecParser.from_openapi(spec_dict)
client = OpenAPIClient(spec, headers={"Authorization": "Bearer token"})
# await client.resource.operation(...)
Requires Python 3.10 or later; all calls are async and must be awaited.
Verify before relying
- Whether the package handles all OpenAPI versions or has known compatibility gaps.
- Performance characteristics when working with very large specs or many concurrent requests.
- Quality of error messages and debugging experience when API calls fail.
- How file uploads are handled across different API specs and content types.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — fastcore, fasttransport |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 10,253,945/month — #1,465 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastspec-0.2.1-py3-none-any.whl
Keywords: nbdev
Tags
More WWW/HTTP packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
h11h11 is a pure-Python HTTP/1.1 protocol…
permissive · top 100 on PyPI
httpxHTTPX is a fully featured HTTP client library…
permissive · top 100 on PyPI
httpcoreA minimal low-level HTTP client library that…
permissive · top 100 on PyPI
aiohttpaiohttp is an async HTTP client and server…
permissive · top 100 on PyPI
openapi3Parses and validates OpenAPI 3 specifications,…
permissive · top 15,000 on PyPI
spectreeGenerates OpenAPI documents and validates HTTP…
permissive · top 15,000 on PyPI
daytona_analytics_api_client_asyncAsync Python client for the Daytona Analytics…
unclear · top 5,000 on PyPI
ogx_open_clientProvides an OpenAPI-generated Python client for…
permissive · top 15,000 on PyPI
daytona_toolbox_api_client_asyncAn async Python client for the Daytona Toolbox…
permissive · top 5,000 on PyPI
apispecGenerates OpenAPI specification documents from…
permissive · top 5,000 on PyPI
flask-pydantic-specAdds OpenAPI documentation generation and…
unclear · top 15,000 on PyPI
prancePrance parses and validates Swagger/OpenAPI 2.0…
unclear · top 5,000 on PyPI
openapi-python-clientGenerates type-annotated Python HTTP clients…
permissive · top 5,000 on PyPI
neptune-apiA generated Python client library for the…
permissive · top 5,000 on PyPI