wrapid: Micro framework built on Python WSGI for RESTful server APIs
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
HTML4.py
HTML5.py
README.md
__init__.py
apache2.cnf
application.py
documentation.py
example.py
fields.py
file.py
html5_representation.py
html_representation.py
json_representation.py
login.py
methods.py
mimeparse.py
representation.py
request.py
responses.py
standard.css
swedish.txt
testbase.py
text_representation.py
utils.py
webresource.py
xml_representation.py

README.md

Wrapid: Micro framework built on Python WSGI for RESTful server APIs

  • Designed for a RESTful resource-oriented architecture.
  • Provides the basis for a well-organized API uniform for all representations, including HTML for human browsers, and JSON for programmatic access.
  • Includes HTML output generation classes (derived from the HyperText module).
  • Predefined class for HTML representation in a standard page layout.
  • Built-in support to produce documentation of the API by introspection.
  • Agnostic as to back-end storage; no Object-Relational Manager (ORM), or other built-in DB connection.
  • Uses Python WSGI as the web server interface.

The framework defines four distinct phases in the server's processing of a request. The application code built on the framework can use an HTTP Response exception to jump out of the normal processing during any of the four phases.

  1. Prepare: connect to a database, authenticate the request, etc.
  2. Handling: update database, modify server-side resources, etc.
  3. Data: Collect the data for the response.
  4. Response: Select the representation, and return the response data in it.

The source code distribution contains an example implementation 'example.py', which illustrates a few of the features. To install it, enable the mod_wsgi module in your Apache2 installation, and add the contents of the file 'apache2.cnf' (available in the distribution) to your Apache2 configuration file 'sites-available/default' (or similar).

The wrapid framework is written in Python 2.6. The following source code packages are needed:

Of course, this web application is itself implemented using wrapid. The links in the navigation panel to the left show some example resources.