Code Monkey home page Code Monkey logo

roax's Introduction

Roax

License Python GitHub Travis CI Codecov

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

roax's People

Contributors

pbryan avatar bsiggers-sfdc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.