Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/berislavlopac/pyotr
Python OpenAPI-to-REST (and back) framework
https://github.com/berislavlopac/pyotr
openapi python-api python-api-client python-framework python-openapi python-server
Last synced: 4 days ago
JSON representation
Python OpenAPI-to-REST (and back) framework
- Host: GitHub
- URL: https://github.com/berislavlopac/pyotr
- Owner: berislavlopac
- License: mit
- Created: 2019-07-01T22:41:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-22T03:08:00.000Z (about 2 years ago)
- Last Synced: 2024-10-29T22:56:01.536Z (13 days ago)
- Topics: openapi, python-api, python-api-client, python-framework, python-openapi, python-server
- Language: Python
- Homepage: https://pyotr.readthedocs.io
- Size: 1.02 MB
- Stars: 57
- Watchers: 4
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Pyotr
=====[![Documentation Status](https://readthedocs.org/projects/pyotr/badge/?version=latest)](https://pyotr.readthedocs.io/en/latest/)
[![CI builds](https://b11c.semaphoreci.com/badges/pyotr.svg?style=shields)](https://b11c.semaphoreci.com/projects/pyotr)**Pyotr** is a Python library for serving and consuming REST APIs based on
[OpenAPI](https://swagger.io/resources/open-api/) 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](https://www.starlette.io)-based framework for serving OpenAPI-based services.
It is functionally very similar to [connexion](https://connexion.readthedocs.io), except that it aims to be fully
[ASGI](https://asgi.readthedocs.io)-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)
### Clientfrom pyotr.client import Client
client = Client.from_file("path/to/openapi.yaml")
result = client.some_endpoint_id("path", "variables", "query_var"="example")