Luchita

Ezra -ez- Nugroho’s blog

REST and Python

Posted on | September 29, 2008 |

As I mentioned here, recently I’ve been doing some research in REST. Specifically, I’ve been looking for ways to implement REST web services for some of our Python-based routines. The idea is to do it in a way that is describable in a WSDL, so that we can control that from a workflow engine in the future.

If you are more or less in the same boat, here is some recommendations to ease your research.

First, read the basics:

You’d need to find out if you just need to publish your services, or if you also need to consume other people’s services, or both. Yahoo’s guide is really good in showing how you’d consume Yahoo’s (and others) services, while the other two guides explain how to publish.

For us, we need to both publish and consume services. We have decided to implement our producer part of it (the web services provider) using Pylons. Here are Pylons essentials to create RESTfull services:

If frameworks is to limiting, and you would like to roll your own REST publishing engine, look at the following:

  • Selector - A python WSGI routing system
  • Yaro - A simple but non-restrictive WSGI abstractor for end user

To implement the client part, read the following:

Further reading:

Good luck!

http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/digg_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/reddit_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/dzone_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/delicious_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/blinklist_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/BlogMarks_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/furl_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/technorati_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/magnolia_48.png http://www.ezran.org/blog/wp-content/plugins/sociofluid/images/yahoobuzz_48.png

Comments

9 Responses to “REST and Python”

  1. John
    October 1st, 2008 @ 2:09 pm

    Great resources! I recently wrote an article about writing REST apps with web.py.

  2. jhcore.com » Blog Archive » Getting RESTful with web.py
    October 1st, 2008 @ 6:17 pm

    [...] REST and Python Tags: python, rest, web.py [...]

  3. Mohamed
    October 1st, 2008 @ 7:15 pm

    The href for A very thorough guide on Python HTTP Web Services, from ‘Dive into Python’

    is wrong. Thanks for the article.

  4. ezran
    October 1st, 2008 @ 9:35 pm

    Mohamed,

    Thanks for the correction. The href is corrected now.

  5. Keith Chapman
    October 2nd, 2008 @ 9:09 pm

    I’m not familiar with Pylons ,can it generate a WSDL for you?

    Recently we (WSO2) released an alpha version of a Web Services Framework for Jython (WSF/Jython). As of not it does not support REST (its a open source project and we would like people getting involved with it) but its a trivial feature to add. I guess you’ve already seeing how we could do <a href=”http://www.keith-chapman.org/2008/09/restfull-mashup-with-wsdl-20-wso2.html”REST services with Javascript on the WSO2 Mashup Server. We could easily do something similar to this.

    BTW we would generate both a WSDL 1.1 and WSDL 2.0 for you too.

  6. Keith Chapman
    October 2nd, 2008 @ 9:09 pm

    I’m not familiar with Pylons ,can it generate a WSDL for you?

    Recently we (WSO2) released an alpha version of a Web Services Framework for Jython (WSF/Jython). As of not it does not support REST (its a open source project and we would like people getting involved with it) but its a trivial feature to add. I guess you’ve already seeing how we could do REST services with Javascript on the WSO2 Mashup Server. We could easily do something similar to this.

    BTW we would generate both a WSDL 1.1 and WSDL 2.0 for you too.

  7. ezran
    October 8th, 2008 @ 12:19 pm

    Keith,

    Pylons is really a web framework, not a web-services framework.

    It doesn’t generate any WSDL, so we would have to generate our own.

  8. rascunho » Blog Archive » links for 2008-10-10
    October 10th, 2008 @ 1:05 pm

    [...] REST and Python | Luchita Specifically, I’ve been looking for ways to implement REST web services for some of our Python-based routines. (tags: http://www.ezran.org 2008 mes9 dia10 REST Python lista_de_links) [...]

  9. omtv
    November 5th, 2008 @ 8:08 pm

    This is quite a useful guide in doing restful python service.
    Thanks for sharing.

Leave a Reply