I'm writing a new one (for Netflix), and am simply wondering if there are any great reference libraries for me to study.
In particular I'm looking for clever ways to express a single REST endpoint in code, which needs a least a URL, method, and params, and in the case of Netflix, information about the authentication level required.
To be clear, I am looking for idiomatic and well-written Python libraries covering REST APIs. If the library is blazing fast, but is difficult to use and/or poorly written, I'm probably less interested.
This is a really old question, but since I came to it still, I thought I'd provide a quick answer.
I've used the GitHub3 wrapper a fair bit and I've always been really impressed by the documentation. One issue with using it as a guide is that it's absolutely huge.
Another nice wrapper is the Gdax-python wrapper for accessing the Gdax exchange for cryptocurrencies. Though it's seriously lacking in-code documentation and I'm not a fan of having separate clients for public API calls and authenticated API calls, I've always found it remarkably easy to use.
I'm sure there are a ton of other ones, but many of the ones I've used fall into some major traps. A couple personal recommendations:
have a single client class that manages all communications
set up a client requests.Session() object to set up all auth/header information for all calls
use a single _make_requests class function that assembles the url, sends the request, and handles all the various HTTP status codes that can be returned.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With