Skip to main content

Generator of python HTTP-clients from OpenApi specification.

Project description


Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic.

Build Status codecov Code style: black

Python pypi

license


Features

Examples

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")

Development

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.23.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

pythogen-0.1.23-py3-none-any.whl (27.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page