Generator of python HTTP-clients from OpenApi specification.
Project description
Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic.
Help
See documentation for more details.
Examples
- Sync and async clients for Petstore OpenAPI
Installation
Pip
pip install pythogen
Docker
docker pull artsmolin/pythogen
Generation
path/to/input
— path to the directory with openapi.yaml;path/to/output
— the path to the directory where the generated client will be saved;
Pip
pythogen path/to/input/openapi.yaml path/to/output/client.py
Docker
docker run \
-v ./path/to/input:/opt/path/to/input \
-v ./path/to/output:/opt/path/to/output \
artsmolin/pythogen \
path/to/input/openapi.yaml \
path/to/output/client.py
Usage
from petstore.client_async import Client
from petstore.client_async import Pet
from petstore.client_async import EmptyBody
client = Client(base_url="http://your.base.url")
pets: list[Pet] | EmptyBody = await client.findPetsByStatus(status="available")
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
pythogen-0.1.25.tar.gz
(19.5 kB
view hashes)
Built Distribution
pythogen-0.1.25-py3-none-any.whl
(27.2 kB
view hashes)
Close
Hashes for pythogen-0.1.25-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 902814a1cb97155c067f56c5491d86851c83937c70bef160b22b36a62d1e31fa |
|
MD5 | d054a92e36070e6ba5e2c3631b2d4695 |
|
BLAKE2b-256 | d416d6fab188a4e39bda5adb709913a27d73f23ac979ce44ab8a21cd93ad0583 |