Skip to main content

Simple Open API Client generator

This project was made to generate a simple client (async or not) from an openapi specifications (unlike other client generators, which typically produce code that is difficult for python beginners to use). It aims to produce a single file that contains the Client class.

Notes

This project is in alpha and has probably bugs. Issues/bugfixes/additions are welcome.

Installation

$ pip install simple-openapi-client

Usage

This package is usage from a Python script. Simply load the openapi file (from local file or url) and make the client.

For instance:

from simple_openapi_client import parse_openapi, make_client, Config

config = Config(client_name='Orthanc', package_name='client')
document = parse_openapi(url_or_path='https://api.orthanc-server.com/orthanc-openapi.json')
client_str = make_client(document, config, use_black=True)

with open(f'./{config.package_name}.py', 'w') as file:
    file.write(client_str)

Or, for an async client:

from simple_openapi_client import parse_openapi, make_client, Config

config = Config(client_name='AsyncOrthanc', package_name='async_client')
document = parse_openapi(url_or_path='https://api.orthanc-server.com/orthanc-openapi.json')
client_str = make_client(document, config, async_mode=True, use_black=True)

with open(f'./{config.package_name}.py', 'w') as file:
    file.write(client_str)

Metadata

Release files for simple-openapi-client 0.5.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-openapi-client 0.5.4
File Size Uploaded Provenance Actions
simple_openapi_client-0.5.4.tar.gz 7.4 kB Without provenance Details for simple_openapi_client-0.5.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for simple-openapi-client 0.5.4
File Interpreter ABI Platform Actions
simple_openapi_client-0.5.4-py3-none-any.whl Python 3 none any Details for simple_openapi_client-0.5.4-py3-none-any.whl

Total release size: 19.3 kB

Release files / simple_openapi_client-0.5.4.tar.gz

Download URL simple_openapi_client-0.5.4.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
02899d8401bb461d9f885755f014c613ea192e445ddefbd6af1888792a675f9a
BLAKE2b-256 checksum
How to use checksums
063018f2e315bbbf95b90f0a98af092cd6f6d8b0326e734fb7c51369ecaf85e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-200.fc39.x86_64

Release files / simple_openapi_client-0.5.4-py3-none-any.whl

Download URL simple_openapi_client-0.5.4-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c175557b6e4adf37300fe7687b21f806571c74cc5a836a232ab13c6269ed069
BLAKE2b-256 checksum
How to use checksums
a8c819d9ac27e54f10ba4476e7574dc56c37367309007f40a7522ff4a402f3aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.3 Linux/6.8.9-200.fc39.x86_64

Security for simple-openapi-client 0.5.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page