skillfed

bravado

Library for accessing Swagger-enabled API's

bravado v12.0.1 328.2K downloads/30d#7,558 on PyPI609
Permissive license BSD 3-Clause License Active released

What it is and what it does

Bravado is a Python library that reads an OpenAPI Specification 2.0 document and constructs a live REST client from it, letting you call API operations as Python method calls without writing boilerplate or running a code generator. It was created by Yelp as a maintained fork of the original swagger-py project and aims to replace the need for swagger-codegen in Python workflows.

The library handles HTTP communication, authentication (basic auth, API keys, custom headers), and response parsing automatically. It supports both synchronous HTTP clients (via RequestsClient) and asynchronous clients (via FidoClient when installed with the fido extra). You point it at a Swagger JSON URL, and it builds a client object whose attributes and methods mirror the API structure defined in the specification.

Use it for:

  • Build a Python client for a third-party REST API that publishes an OpenAPI 2.0 spec without writing manual HTTP code.
  • Integrate with internal microservices that expose OpenAPI specifications, generating clients on the fly at runtime.
  • Test or prototype against a Swagger-documented API without waiting for code generation or maintaining hand-written client stubs.
  • Add basic or header-based authentication to API calls through a simple configuration interface.
  • Use asynchronous HTTP requests to a Swagger API by swapping in FidoClient for concurrent operations.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Bravado generates a dynamic REST client from an OpenAPI Specification 2.0 document, allowing you to call API endpoints as Python methods without code generation.

Yes, with conditions. Bravado is stable (Production/Stable status, 609 GitHub stars, active repository) and solves a real problem—eliminating code generation for OpenAPI 2.0 clients. However, high install friction and a 464-day release gap warrant checking that your environment can satisfy its dependencies and that OpenAPI 2.0 is your target (not 3.0+). If you need dynamic REST clients and your APIs publish OpenAPI 2.0 specs, it is worth the setup cost.

Install

bravado on PyPI

pip

pip install bravado

uv

uv add bravado

poetry

poetry add bravado

Installing bravado

Before you install

High install friction: no runtime dependencies listed, but the package itself is marked as high-friction. Last release was 464 days ago; repository is active with recent commits (2026-04-02) and 609 stars, suggesting ongoing maintenance despite the release gap.

License in practice

BSD 3-Clause License is permissive and poses no restrictions on commercial or private use. You may use, modify, and distribute Bravado freely provided you include the license notice.

Quickstart

from bravado.client import SwaggerClient
client = SwaggerClient.from_url('http://petstore.swagger.io/v2/swagger.json')
pet = client.pet.getPetById(petId=1).response().result

Requires Python 3.8 or later; the OpenAPI Specification document must be accessible at the provided URL.

Verify before relying

  • Whether high install friction stems from compiled dependencies, system library requirements, or network access during installation.
  • Current compatibility with OpenAPI 3.0+ specifications (fact sheet only mentions 2.0 support).
  • Whether the 464-day gap since last release indicates maintenance slowdown or stability-driven infrequent updates.

Package facts

License BSD 3-Clause License (permissive)
Python support supports the current Python release (>=3.8)
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 464 days since the last release
Last repo commit
First released
Downloads 328,167/month — #7,558 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: bravado-12.0.1.tar.gz

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Software Development :: Libraries :: Python Modules

Tags

openapi client library pythonswagger api clientrest api client from specdynamic swagger clientopenapi 2.0 pythonapi specification clientswagger codegen alternative
rest-clientopenapiswagger

More Python Modules packages