Skip to main content

Python OpenAPI-to-REST (and back) framework

Project description

Pyotr

Documentation Status CI builds

Pyotr is a Python library for serving and consuming REST APIs based on OpenAPI specifications. Its name is acronym of "Python OpenAPI to REST".

The project consists of two separate libraries that can be used independently:

  • pyotr.server is a Starlette-based framework for serving OpenAPI-based services. It is functionally very similar to connexion, except that it aims to be fully ASGI-compliant.
  • pyotr.client is a HTTP client for consuming OpenAPI-based services.

WARNING: This is still very much work in progress and not quite ready for production usage. Until version 1.0 is released, any version can be expected to break backward compatibility.

Quick Start

Server

from pyotr.server import Application
from some.path import endpoints

app = Application.from_file("path/to/openapi.yaml", module=endpoints)

Client

from pyotr.client import Client

client = Client.from_file("path/to/openapi.yaml")
result = client.some_endpoint_id("path", "variables", "query_var"="example")

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

pyotr-0.8.0.tar.gz (9.1 kB view hashes)

Uploaded Source

Built Distribution

pyotr-0.8.0-py3-none-any.whl (10.6 kB view hashes)

Uploaded Python 3

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