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.2.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simple-openapi-client-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a6799bfdea5e7cb7a21d380f13d297da5834ff47b74baf8bf39bf4600328ac00
MD5 56bfcf2f2761b589dc5200101a98a0e6
BLAKE2b-256 08b0690fb92a32a0915bcc77b686093e3a41d72046d5554052fe0de085d2218f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for simple_openapi_client-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e446a2772841bde2248d12d73fa9386c4eadea3e9ed32747d1c10b1d009da496
MD5 b2e2b48d80f7224c7e1d12c2720aed00
BLAKE2b-256 8d0b9fd24b2f2cbac61ccafa79d03f113116a025a9f293ca4b04d6ae66c816f1

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