Is there a Generic python library to consume REST based services?

Question:

Ok. I want to consume REST based services.

I’d like to use python. In fact, I am going to use python.

The way I’d like to use it is from the command line/ipython, to try out different REST services, with intention of formally coding it later. ( my usage of the REST service not the generic api thing )

I’m looking for a pretty generic, fully featured REST client/API in python. Not bare bones, but plush, nice to use. There are tons of them out there, but I’d kind of like to settle on one and master it.

Any suggestions?

EDIT: This is one:

https://github.com/benoitc/restkit

EDIT: http://pypi.python.org/pypi/requests is exactly it.

EDIT: http://pypi.python.org/pypi/siesta is just as perfect!

Asked By: chiggsy

||

Answers:

The problem with having a “plush” REST client library is that REST itself isn’t that well-defined. REST, in and of itself, just means that you want to use HTTP standards whenever possible, but other than that, the field is wide open.

Is the data encoded with JSON? What are the URL schemes and what do they mean?

Since REST basically just means HTTP, your best bet is httplib, but I wouldn’t describe it as plush.

Answered By: Ken Kinder

I’ve mostly used just urllib2 or httplib2. I haven’t really found a use for a general purpose REST client.

Answered By: Casey

Something like a generic REST library is hardly possible since each REST interface is different. Whith WADL there has been an attempt to establish a WSDL-lik interface description language for RESTful services. Using such a description a generic client would be possible but no one seems to care about WADL. And everyone seems fine with that.

Answered By: h0b0
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.