Lightweight framework for building resource-oriented applications.
Project description
Roax
Ro·ax /ˈɹoʊ.æks/
A lightweight Python resource-oriented framework.
Introduction
Roax is a lightweight framework for building resource-oriented applications in Python. By composing your application as a set of resources that expose operations through a uniform interface, they can be automatically exposed through a REST and/or command line interface.
Features
- Resource operations accessed through WSGI based REST API.
- Command-line interface to resource operations.
- Generates OpenAPI interface description, compatible with Swagger UI.
- Schema enforcement of resource operation parameters and return values.
- Authorization to resource operations enforced through imperative security policies.
Quick start
Installation
pip install roax
Hello world
Here is a minimal application that responds with "Hello world!"
when the
client accesses http://localhost:8000/hello.
import roax.schema as schema
from roax.resource import Resource, operation
from roax.wsgi import App
from wsgiref.simple_server import make_server
class HelloResource(Resource):
@operation(returns=schema.str(), security=[])
def read(self):
return "Hello world!"
app = App("/", "Hello", "1.0")
app.register_resource("/hello", HelloResource())
if __name__== "__main__":
make_server("", 8000, app).serve_forever()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
roax-1.3.1.tar.gz
(32.4 kB
view details)
Built Distribution
roax-1.3.1-py3-none-any.whl
(36.9 kB
view details)
File details
Details for the file roax-1.3.1.tar.gz
.
File metadata
- Download URL: roax-1.3.1.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/5.2.0-2-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86051bb266f832c98a253891ed385c46f635c44a0b1d109bcea2877f90753e4b |
|
MD5 | 740835ba0fb64e2765e90df88c6896b6 |
|
BLAKE2b-256 | 35a003ee5a4efcdb5bc96c1e541c90da049a3b931ddf237d7960d127403fbe1c |
File details
Details for the file roax-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: roax-1.3.1-py3-none-any.whl
- Upload date:
- Size: 36.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/5.2.0-2-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4478be3f25b93f560bed18ef9b0d031037f928e911a4ff6bde9ac186d7d43cd6 |
|
MD5 | 4be42ede8e5ca1e5bd39d16a25d38171 |
|
BLAKE2b-256 | b67f53ee94d058944109ed1f22dc0ca149f0e2a28ac54025e17521155f76b54c |