Bravado
About
Bravado is a Yelp maintained fork of digium/swagger-py for use with OpenAPI Specification version 2.0 (previously known as Swagger).
From the OpenAPI Specification project:
The goal of The OpenAPI Specification is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection.
Client libraries can automatically be generated from the OpenAPI specification, however Bravado aims to be a complete replacement for code generation (swagger-codegen).
Example Usage
from bravado.client import SwaggerClient
client = SwaggerClient.from_url('http://petstore.swagger.io/v2/swagger.json')
pet = client.pet.getPetById(petId=1).response().result
Example with Basic Authentication
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient
http_client = RequestsClient()
http_client.set_basic_auth(
'api.yourhost.com',
'username', 'password'
)
client = SwaggerClient.from_url(
'http://petstore.swagger.io/v2/swagger.json',
http_client=http_client,
)
pet = client.pet.getPetById(petId=1).response().result
Example with Header Authentication
from bravado.requests_client import RequestsClient
from bravado.client import SwaggerClient
http_client = RequestsClient()
http_client.set_api_key(
'api.yourhost.com', 'token',
param_name='api_key', param_in='header'
)
client = SwaggerClient.from_url(
'http://petstore.swagger.io/v2/swagger.json',
http_client=http_client,
)
pet = client.pet.getPetById(petId=1).response().result
Example with Fido Client (Async Http Client)
# Install bravado with fido extra (``pip install bravado[fido]``)
from bravado.fido_client import FidoClient
from bravado.client import SwaggerClient
http_client = FidoClient()
client = SwaggerClient.from_url(
'http://petstore.swagger.io/v2/swagger.json',
http_client=http_client,
)
pet = client.pet.getPetById(petId=1).response().result
Documentation
More documentation is available at http://bravado.readthedocs.org
Installation
# To install bravado with Synchronous Http Client only.
$ pip install bravado
# To install bravado with Synchronous and Asynchronous Http Client (RequestsClient and FidoClient).
$ pip install bravado[fido]
Development
Code is documented using Sphinx.
virtualenv. is recommended to keep dependencies and libraries isolated.
Setup
# Run tests
tox
# Install git pre-commit hooks
tox -e pre-commit install
Contributing
Fork it ( http://github.com/Yelp/bravado/fork )
Create your feature branch (git checkout -b my-new-feature)
Add your modifications
Commit your changes (git commit -m "Add some feature")
Push to the branch (git push origin my-new-feature)
Create new Pull Request
Releasing a new version (Yelpers only)
See https://yelpwiki.yelpcorp.com/pages/viewpage.action?pageId=19022447
License
Copyright (c) 2013, Digium, Inc. All rights reserved. Copyright (c) 2014-2021, Yelp, Inc. All rights reserved.
Bravado is licensed with a BSD 3-Clause License.
Metadata
Release files for bravado 12.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bravado-12.0.1.tar.gz | 37.6 kB | Without provenance | Details |
Release files / bravado-12.0.1.tar.gz
| Download URL | bravado-12.0.1.tar.gz |
|---|---|
| Size | 37.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
637cc04d53c07e950792595081f9f8bf4dea226ecd1029207cb1d328ea400e20
|
|
BLAKE2b-256 checksum How to use checksums |
885d5a1eda160279e4a617c38da71fbb7d92121cfc7fcf8592368286f771e314
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.10
|
Security for bravado 12.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.