https://github.com/felixthec/openapi-fastapi-client
A tool to autogenerate FastApi Clients from given openapi.yaml.
https://github.com/felixthec/openapi-fastapi-client
fastapi openapi3 python3 typer
Last synced: 5 months ago
JSON representation
A tool to autogenerate FastApi Clients from given openapi.yaml.
- Host: GitHub
- URL: https://github.com/felixthec/openapi-fastapi-client
- Owner: FelixTheC
- License: mit
- Created: 2022-11-10T19:27:40.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-07T07:00:35.000Z (over 2 years ago)
- Last Synced: 2024-12-15T08:27:59.946Z (5 months ago)
- Topics: fastapi, openapi3, python3, typer
- Language: Python
- Homepage:
- Size: 2.57 MB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: license.md
Awesome Lists containing this project
README
[](https://www.python.org/downloads/release/python-3100/)

[](https://github.com/psf/black)
[](https://pycqa.github.io/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
```shell
pip install openapi-fastapi-client
```## Usage
```shell
openapi-fastapi-client ./openapi.yaml ./my-client
```
```shell
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
```shell
openapi-fastapi-client --help
```