skillfed

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

fastspec v0.2.1 10.3M downloads/30d#1,465 on PyPI4
Permissive license Apache-2.0 Active released

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 fastspec

uv

uv add fastspec

poetry

poetry add fastspec

Installing 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

Programming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

openapi client generatorapi spec to python clientasync api client from specgoogle discovery clientdynamic api client builderopenapi python asyncspec-driven http client
api-clientopenapiasync

More WWW/HTTP packages