Generator of python HTTP-clients from OpenApi specification.
Project description
Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic.
Features
Examples
- Sync and async clients for Petstore OpenAPI
Installing the library and generating clients
By Docker
docker pull artsmolin/pythogen
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
or directly
pip install pythogen
pythogen path/to/input/openapi.yaml path/to/output/client.py
Usage client
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.22.tar.gz
(19.5 kB
view hashes)
Built Distribution
pythogen-0.1.22-py3-none-any.whl
(27.4 kB
view hashes)
Close
Hashes for pythogen-0.1.22-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ef779e3210c63ffba550f9a02cc1002c830bb49ef4d7d2516dfeef672ee72af |
|
MD5 | 435a6cc8953bca7ac26c9e3ce9c0c588 |
|
BLAKE2b-256 | 03fbe865001b1acf1012c2ee5790b5c49dcb9491451f942073a80dd7805b0c2f |