A CLI tool that generates HTTP clients from an OpenAPI specification
Project description
A CLI tool that generates HTTP clients from an OpenAPI specification.
Installation
pip install gadopenapiconverter
Usage
gadopenapiconverter --file {config.toml} --context "{}"
General Structure
workdir = "myproject"
[[specifications]]
path = "{{name}}.py"
content = "file:openapi.json"
client = "httpx"
model = "pydantic"
async = true
operations = []
[[scripts]]
command = "isort {{workdir}}"
check = true
Sections Overview
| Section | Format | Description | ||
|---|---|---|---|---|
workdir |
"" |
Uses the current directory | ||
"myproject" |
Uses the current directory + /myproject |
|||
"/home/myproject" |
Uses an absolute path | |||
[[specifications]] |
Defines file creation rules | |||
mode = "a" |
File writing mode: "a" (append), "w" (overwrite) |
|||
path = "src/__init__.py" |
Relative to workdir, specifies file location. | |||
content = """ ... """ / path / url |
Raw content, local file path, or URL for remote content. | |||
model = "pydantic" |
Type of models created (pydantic, dataclasses, typing, msgspec) | |||
client = "httpx" |
Type of http-client created (requests, httpx, aiohttp, urllib, urllib3, http.client) | |||
async = "true" |
Type of methods (true, false) | |||
operations = [] |
Filtering methods by operation_id | |||
[[scripts]] |
Defines commands to be executed after generation. | |||
command = "isort {{workdir}}" |
Command to execute, supports dynamic variables. | |||
check = True\False" |
If true, raises an error if the command fails, otherwise logs output. |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gadopenapiconverter-0.0.2.tar.gz
(15.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gadopenapiconverter-0.0.2.tar.gz.
File metadata
- Download URL: gadopenapiconverter-0.0.2.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed91f85badde6f2ed340d5d7f1093c428baea5af0517e89de1050eb66cb4b19
|
|
| MD5 |
05794674ef5541d6b02d6ecdac42d5de
|
|
| BLAKE2b-256 |
4407f0ad9988a45ab7e3fe59bb904ca231fcc9bc53b07f30f843082bb5d27a0a
|
File details
Details for the file gadopenapiconverter-0.0.2-py3-none-any.whl.
File metadata
- Download URL: gadopenapiconverter-0.0.2-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fe8e32de8436772fadca5400246693294130210d3cbca12597f90bceeefe16d
|
|
| MD5 |
dcbd068bff3701e477fc63fd95d88c15
|
|
| BLAKE2b-256 |
637d1c10de272f8a85e5fbe3a3f7af35f0a520833b2fe91bcdd2400259ce84cf
|