My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Wiki pages
Links

Current Release: v1.0 Alpha4 (if you are adventurous consider following the Subversion trunk) / RoadMap


prestans is a WSGI (PEP-333) complaint micro-framework that allows you to rapidly build quality REST services by introducing a pattern of models, parsers and handlers and in turn taking care of boilerplate code that you would have had to write otherwise, some key features are:

  • patterns to serialize data in JSON or YAML, you provide REST models, prestans does the rest
  • URL dispatcher that validates data provided in the URLs (supports regular expressions)
  • validate all incoming and outgoing data using strongly defined models and parameter sets.
  • integration with your applications' authentication mechanism using a provider/consumer pattern
  • caching framework that is able to automatically serve cached content if a request matches conditions.
  • set of data adapters that allow you to quickly turn persistent objects into REST objects (e.g SQLAlchemy or DataStore).
  • well written library of boilerplate code that handles the default scenarios (e.g handling unmapped URLs, authentication errors, etc).

The framework was born out of our team identifying patterns of boilerplate code and the lack of a standard for writing REST based services. We actively use prestans under Apache and Google's App Engine. Our applications generally also feature heavy use of Ajax interfaces generally built using Google's Closure library.

Our philosophy is "take as much or as little of the project that you like". prestans is designed to work along side any other Python Web framework that your project may already employ.

prestans is WSGI compliant and should work under most popular Cloud hosting environments that support Python as well as popular Web Servers (if you are using Apache please look at mod_wsgi).

And incase you are still wondering prestans is a latin word meaning "excellent, distinguished, imminent."

Looks like prestans might work for you? Consider reading GettingStartedPython or if you are feeling confident and want to hack some code RequestHandlers.

Donations and Sponsorships

A considerable amount of time has been invested in building prestans and writing it's complimentary documentation, all of which is made available free of charge under an extremely liberal license. If prestans has helped you write awesome REST apps, consider making a donation to the development of this project via PayPal. If you would like to sponsor a feature request, please write to one of the developers.

All donations are used to fund future development efforts for the prestans project. Funds are administered by Eternity Technologies. If you require a Tax Invoice for your donation, please write to us.

Client side tools

As a result prestans also provides a few extra goodies to speed up building REST clients in your Google Closure or iOS apps:

  • JavaScript REST client, a prewritten mechanism to place REST calls, and parse the JSON output into client side Model objects (extremely good if you are using Javascript Compilers).
  • Cocoa REST Client, uses async networking and allows parsing REST responses to Cocoa Objects.
  • preplate a tool that allows you to automatically generate client side model parsers for your REST JSON data (depends on the prestans Model framework).
  • A standard mechanism for client side request generation for your REST services.
  • Various JavaScript UI widgets that we have worked on overtime mostly to automate drawing large data driven forms.

Also in our Roadmap is:

  • presh a command line tool to automate testing of your REST services.

Software Requirements

Lessons we've learnt about REST

prestans directly represents things we have concluded as Ajax application developers. We believe its important for us to share our philosophy so you can understand how prestans approaches REST development.

REST data as Views rather than Entities

Representational State Transfer or REST defines a standard by which the state of an entity can be transferred over HTTP.

Entities are generally refer to persistent data. We believe that the entity transferred to the client is often a view of the persistent entity.

This is because data is often stored very differently and have to be padded with additional information (or strip away excess information) when transferred down the pipe. The represented entity can often have related data as part of the response which might be obtained by one or more calls to the persistent store.

prestans introduces a Model definition layer that is expected and understood by the REST layer, it provides utilities to parse, validate and serialise these models. It also provides adapters to translate these REST models into objects acceptable by popular persistence frameworks.

Handlers are actions

If you consider URLs map to views, then view your API URLs as actions performed on those views.

CRUD operations are handled by simple URL schemes, that identify an entity and the action identified by the method. All useful applications have complex interactions e.g move an article from section A to section B.

Think of each one of these as a concrete interaction and assign them a URL, this splits your REST handler code and ensures that the called URL is a direct representation of concepts in your application.

About the Authors

prestans was developed by Devraj Mukherjee and Bradley Mclain while building large scale Web applications at Eternity Technologies. These applications run on a Google's App Engine and servers running Apache + mod_wsgi.

Most contributions made to prestans are done while working on commercial projects. Have a look at ProjectsUsingPrestans.

We sometimes have things to say on our Twitter streams and are actively involved on our mailing list.

If you have a feature request please post it on the list or lodge it as an issue on the Issue Tracker.

Powered by Google Project Hosting