Skip to main content

Lightweight framework for building resource-oriented applications.

Project description

Roax

GitHub PyPI Travis CI Codecov License

Ro·ax /ˈɹoʊ.æks/
A lightweight Python resource-oriented framework.

Introduction

Roax is a framework for building resource-oriented applications in Python. By composing your application of resources that expose operations in a uniform interface, they can be 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.1.0.tar.gz (28.5 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: roax-1.1.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.7.2rc1

File hashes

Hashes for roax-1.1.0.tar.gz
Algorithm Hash digest
SHA256 776875b804dcb5662d144c63b83e1f0c10c02e73c814fca60eee37d87f368788
MD5 ba3fd985cc9af0a392d6a6beae68d345
BLAKE2b-256 3a8bbce03857dca02e2febbbeb0c96cb78f4e8e48748f9649359094016e823da

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