views:

65

answers:

3

Hi guys,

Is it possible to create REST Web Services, that returns JSON or XML, using Python ?

Could you give me some recomandations ?

Thank you.

+5  A: 

Short answer: Yes. You certainly can do it with Python, using or without using one of the several tools available for the task.

A bigger answer is difficult (and pointless) without knowing more about your requirements. I suggest that you explore the various options and decide for yourself.

Manoj Govindan
+1: "Could you give me some recomandations ?" Yes. "you explore the various options".
S.Lott
A: 

Sure, you can use any web framework you like, just set the content-type header to the mime type you need. For generating json I recommend the simplejson module (ranamed to json and included in the standard library since 2.6), for handling XML the lxml library is very nice.

Radomir Dopieralski
+1  A: 

Take a look at RESTx. It's fully open source, written in Python and runs in the JVM, so you can write custom components in Python or Java. It's specialized on the creation of RESTful web services. Components are reusable and you create new RESTful web services by merely sending a new component configuration to the server (via a simple RESTful API or by filling out a small form in a web server). I think RESTx is probably the quickest and simplest way to create RESTful web services.

Disclaimer: I'm the lead developer of RESTx. So, if you have any questions, just let me know. I'd be happy to help.

jbrendel