Generator of python HTTP-clients from OpenApi specification based on httpx and pydantic
Documentation: https://artsmolin.github.io/pythogen
Source Code: https://github.com/artsmolin/pythogen
Examples: sync and async clients for Petstore OpenAPI
Installation
You can install the library
pip install pythogen
or use 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;
Generate a client using the installed library
pythogen path/to/input/openapi.yaml path/to/output/client.py
or via 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"),
)
Metadata
Release files for pythogen 0.2.41
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| pythogen-0.2.41.tar.gz | 22.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pythogen-0.2.41-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 53.8 kB
Release files / pythogen-0.2.41.tar.gz
| Download URL | pythogen-0.2.41.tar.gz |
|---|---|
| Size | 22.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9188ad642c5435a977679db6014e54d2a8f63cb04371c7039ac9811d1801dcb3
|
|
BLAKE2b-256 checksum How to use checksums |
61d9af8a72af6bdc6633a9cd6f28583b74a6dab0474d6f0dfef53aaed42c1a95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1024-azure
|
Release files / pythogen-0.2.41-py3-none-any.whl
| Download URL | pythogen-0.2.41-py3-none-any.whl |
|---|---|
| Size | 31.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0b58b6bfe93898207c6a75c25a1bb88c8f880cd4691d9c2b8c01659f28e5661c
|
|
BLAKE2b-256 checksum How to use checksums |
997413f07c6fbc6fea47802a8a725a37f216884cc8cd40c960bc41d71c24ae87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.10.14 Linux/6.5.0-1024-azure
|
Security for pythogen 0.2.41
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.