Skip to main content

OpenAPI Python client generator that follows the KISS principle.

Project description

Simple Open API 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 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')
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.3.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

simple_openapi_client-0.1.3-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for simple-openapi-client-0.1.3.tar.gz
Algorithm Hash digest
SHA256 280f621301f8565e5677cbf5ae6307d5ff2bdf5f060fd1fb80cc346f760b79d5
MD5 891fb59d66b418b831db59ed0fc5cdd9
BLAKE2b-256 85ac86d2a6771d4a1831cc636679a2f4c58ecd1cbf68315cae5c60d4a92615a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_openapi_client-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cf880fbdfec44c2b5aec5ab4c6306e78f7b5efe612056a5f8f397be736b8f6e7
MD5 223c0e3849fdef206f15c3e03de4919c
BLAKE2b-256 61275216a6c926b1c61ad415df3c35d98922a15b823de9bfcdb4c1d7bb4a67ee

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