Skip to content

ponchoinc/cherryontop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Downloads

Latest Version

License

CherryOnTop

CherryOnTop is a library for building JSON API's in Python with CherryPy.

  • Routing: Built in support for binding static and dynamic URLs alongside the methods that implement their logic (a la Bottle / Flask).
  • Server: The power and stability of the CherryPy engine.
  • Utilities: Handling for query parameters and JSON request/response payloads, descriptive messages and clean propagation for error conditions.

"Hello world"

from cherryontop import Controller, get, start_server

class HelloWorld(Controller):

    @get('/hello')
    @get('/hello/:name')
    def hello_world(self, name='world'):
        return {'message': 'Hello %s!' % name}

start_server()

Run this script then point your browser to http://localhost:8080/hello/there (or just http://localhost:8080/hello). That's all there is to it.

Download and Install

pip install cherryontop to install the latest stable release.

License

Code, tutorials, and documentation all released under the BSD license (see LICENSE).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 99.8%
  • Shell 0.2%