The Wayback Machine - https://web.archive.org/web/20220403035430/https://github.com/berislavlopac/pyotr
Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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")