A Python wrapper for restmapper
python-restmapper is a tool that makes writing RESTful API clients a breeze. It removes all of the complexity with writing API-specific code, and lets you focus all your energy on the important stuff. Restmapper will even parse JSON and XML objects and display them nicely, based on a declarative format you provide for each API you integrate with.
python-restmapper is available for download through the Python Package Index (PyPi). You can install it right away using pip or easy_install.
pip install restmapper
No dependencies (besides Python 2.7).
The first thing you need to do is generate a base RestMapper object that will allow you to instantiate a connection a remote API with authentication.
>>> from requests_oauthlib import OAuth1 >>> Twitter = RestMapper("https://api.twitter.com/1.1/", url_transformer=lambda url: url + ".json")
Now, just get an access key and secret, and then start making calls with the API object.
>>> auth = OAuth1('YOUR_APP_KEY', 'YOUR_APP_SECRET', 'USER_OAUTH_TOKEN', 'USER_OAUTH_TOKEN_SECRET') >>> twitter = Twitter(auth=auth) >>> response = twitter.statuses.mentions_timeline()
By default, python-restmapper will return parsed JSON objects. If you’d like the raw response object for a request, just pass in parse_response=False.
>>> response = ... ... your org ...
If you like this library, or need help implementing it, send us an email: firstname.lastname@example.org.
Apache License, Version 2.0. See LICENSE for details.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size restmapper-0.0.2.tar.gz (3.8 kB)||File type Source||Python version None||Upload date||Hashes View|