Skip to main content

OpenAPI Python client generator that follows the KISS principle.

Project description

Simple OPENAPI Client generator

This project was made to generate a simple client 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, probably has many bugs and may not work. Issues/bugfixes/additions are welcome.

Installation

$ pip install 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')
document = parse_openapi(url_or_path='https://api.orthanc-server.com/orthanc-openapi.json')
client_str = make_client(document, config)

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simple-openapi-client-0.1.1.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

simple_openapi_client-0.1.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file simple-openapi-client-0.1.1.tar.gz.

File metadata

  • Download URL: simple-openapi-client-0.1.1.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.5 Linux/5.18.11-200.fc36.x86_64

File hashes

Hashes for simple-openapi-client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2e76783a02bc1556dad2892d0e427d725e4655158c430e9829317e0f59f9b484
MD5 dc769212f53d2110653de85567213971
BLAKE2b-256 032032f3218b3bb0fa161d0deb9ad1e72be0851763b4214651ce6579710bec3e

See more details on using hashes here.

File details

Details for the file simple_openapi_client-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_openapi_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 70f89c4f49d56ccb4d5bdf7913368666821a765732ec9ce76d332d40092a8067
MD5 dbe56403059d6295ac42ff02c070c6ea
BLAKE2b-256 3e121ba0a51e43dcfd303b620ff3da1772accddbe02809134934eeae9f341bc3

See more details on using hashes here.

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