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.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

openapi_fastapi_client-0.2.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for openapi-fastapi-client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9c9f0cc190137cd4412fa710d12c72866f517ffa8c8a50ee6b3dbe1429c564bd
MD5 1f4723f4dab3d475134725c1c7c08c37
BLAKE2b-256 6f09f1d10f8ea639b32543378499d6f10137845be074336e5a23664c0d92fcbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for openapi_fastapi_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60c8317d5e4282e738a80d7ab452f259d462d665ebaa7582af987a8dd7098059
MD5 39ef7323613496d5c6caa4ae8d0c974c
BLAKE2b-256 89140ca015a4e91d1b0b6c7a3eee27aa1591c779a7337e4844f2a9cfe5582a11

See more details on using hashes here.

Supported by

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