Skip to main content

Framework to build/parse OpenAPI

Project description

OSC OpenAPI Framework

Build and parse OpenAPI data using its own structured python object.

Features

  • Build OpenAPI data from structured object
  • Parse OpenAPI data to structured object

Installation

You can install the pre-built python package through this command:

$ pip install osc-openapi-framework

Building

To build the package yourself:

$ make package

You can then install it with:

$ pip install dist/osc_openapi_framework-*.whl

Usage

Parsing OpenAPI Data

from osc_openapi_framework.openapi.parser import parse as openapi_parse

openapi_data = '''
    openapi: 3.0.0
    info:
      title: Sample API
      description: Optional multiline or single-line description in [CommonMark](http://commonmark.org/help/) or HTML.
      version: 0.1.9
    security:
      - ApiKeyAuth: []
    servers:
      - url: http://api.example.com/v1
        description: Optional server description, e.g. Main (production) server
      - url: http://staging-api.example.com
        description: Optional server description, e.g. Internal staging server for testing
    paths:
      /users:
        get:
          summary: Returns a list of users.
          description: Optional extended description in CommonMark or HTML.
          responses:
            '200':    # status code
              description: A JSON array of user names
              content:
                application/json:
                  schema: 
                    type: array
                    items: 
                      type: string
'''
with open('/tmp/openapi_test', 'w') as fd:
  fd.write(openapi_data)
oapi = openapi_parse('/tmp/openapi_test')

License

Copyright Outscale SAS

BSD-3-Clause

This project is compliant with REUSE.

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

osc_openapi_framework-0.0.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

osc_openapi_framework-0.0.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file osc_openapi_framework-0.0.1.tar.gz.

File metadata

  • Download URL: osc_openapi_framework-0.0.1.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for osc_openapi_framework-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0c12fa2eb7d83b3eff3ee0f175dcdad8a2faff681ed4627b815c86c307e2731c
MD5 86df8eae739a1c2fc14c1b2c8180c0e9
BLAKE2b-256 fa733a2dddcddef967bc17bbb090a6c366c19487093b790f4c6ed5d20aec89dc

See more details on using hashes here.

File details

Details for the file osc_openapi_framework-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: osc_openapi_framework-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2

File hashes

Hashes for osc_openapi_framework-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 558c0f1637b8d044b6be15156ef5663d75687c51c692eb038e8729280dca8429
MD5 80eb0b9cb8a81da4337bcd96cf7575f2
BLAKE2b-256 89f7ce91c0f830dda467b06c05a732425a9ac10c359a5ae93ff634ffa3cea383

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