Skip to main content

Lightweight framework for building resource-oriented applications.

Project description

Roax

PyPI License GitHub Travis CI Codecov Black

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

Develop

poetry install
poetry run pre-commit install

Test

poetry run pytest

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.10.1.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

roax-1.10.1-py3-none-any.whl (38.3 kB view details)

Uploaded Python 3

File details

Details for the file roax-1.10.1.tar.gz.

File metadata

  • Download URL: roax-1.10.1.tar.gz
  • Upload date:
  • Size: 33.7 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

Hashes for roax-1.10.1.tar.gz
Algorithm Hash digest
SHA256 9147d9a70f9047bc5761eb34c780593a96851b2a715f9dcd8d32567c9b2bc110
MD5 1f7a39c3d28bb3c0364983d297a210ec
BLAKE2b-256 97ff31acbaee76eed1a4ea5f310d4324d1cf4b2886b2f3361f5bd98cb65dd57c

See more details on using hashes here.

File details

Details for the file roax-1.10.1-py3-none-any.whl.

File metadata

  • Download URL: roax-1.10.1-py3-none-any.whl
  • Upload date:
  • Size: 38.3 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

Hashes for roax-1.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e5e7ae5e776014929f1ba8e9105451a45b3c3ff75ee10cfd19e63161976f0de
MD5 7ef1e2545799149ae612d35e0ebdc20b
BLAKE2b-256 44a95e8159c945823294196282746f89cf25c967cd8703e6d7cbd1367262c3fe

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