Generator of python HTTP-clients from OpenApi specification.
Project description
Awesome python HTTP-clients from OpenAPI
Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic
Documentation
Check documentation to see more details about the features. All documentation is in the "docs" directory and online at artsmolin.github.io/pythogen
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
from petstore.client_async import FindPetsByStatusQueryParams
client = Client(base_url="http://your.base.url")
pets: list[Pet] | EmptyBody = await client.findPetsByStatus(
query_params=FindPetsByStatusQueryParams(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.2.24.tar.gz
(20.8 kB
view hashes)
Built Distribution
pythogen-0.2.24-py3-none-any.whl
(29.1 kB
view hashes)
Close
Hashes for pythogen-0.2.24-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88d19ff526f07a791aced57d5f552efbd8e4ca013498d7820d1b60fa52d5aece |
|
MD5 | 0a2e2df6b2a7dc956dbd64eb75b85496 |
|
BLAKE2b-256 | fc9b592c0c2b561703f13a12acd3456ccd824a5f9d1910c8818ac7e2f89c59eb |