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

PythonRest

Python Problem Overview


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!

Python Solutions


Solution 1 - Python

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.

Solution 2 - Python

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

Solution 3 - Python

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionchiggsyView Question on Stackoverflow
Solution 1 - PythonKen KinderView Answer on Stackoverflow
Solution 2 - PythonCaseyView Answer on Stackoverflow
Solution 3 - Pythonh0b0View Answer on Stackoverflow