Skip to main content

A tool to autogenerate FastApi Clients from given openapi.yaml.

Project description

Python 3.10 Python application Code style: black Imports: isort

Openapi yaml file to FastApi Client

A commandline tool to generate Api functions and their required pydantic Model Schema from an openapi.yaml of version 3

Installation

pip install openapi-fastapi-client

Usage

openapi-fastapi-client ./openapi.yaml ./my-client
openapi-fastapi-client ./openapi.yaml ./my-client --async
  • this will generate under the folder my-client following files
    • __init__.py if not exists
    • api.py here are all function calls to the external api
    • schema.py here are all pydantic Models

Arguments

  • OPENAPI_FILE [required]
  • OUTPUT_PATH [required]

Options

  • --sync All requests to the client are synchronous. default
  • --async All requests to the client are asynchronous with aiohttp.

Help

openapi-fastapi-client --help

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi-fastapi-client-0.2.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openapi_fastapi_client-0.2.1-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file openapi-fastapi-client-0.2.1.tar.gz.

File metadata

  • Download URL: openapi-fastapi-client-0.2.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for openapi-fastapi-client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 4e15322b74a13f30c964cafa0ab885cd218348ce10321592302cdd967763525e
MD5 208d14d22ecb2d06454ea23f96898752
BLAKE2b-256 ad05fe4005a1dd597c197ec6ebd1f31aa86c12d18bca125382ed56e7b8a4d7c1

See more details on using hashes here.

File details

Details for the file openapi_fastapi_client-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for openapi_fastapi_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 eb81c11d93d7657b097a45eee70b41ca96b3ba808a99758f6a1bc8354437888b
MD5 6e07de9f0c29b1648bef52cdbd534f53
BLAKE2b-256 f719c0016628a16a9685dc1e7f5ed09e4fc7c2fbf6772b2a65edfc2ce65fb74c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page