A Python wrapper for restmapper
Project description
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.
Installation
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).
Usage
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()
Miscellaneous
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 ...
Support
If you like this library, or need help implementing it, send us an email: hi@lionheartsw.com.
License
Apache License, Version 2.0. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file restmapper-0.0.2.tar.gz.
File metadata
- Download URL: restmapper-0.0.2.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d7829eebe4efac3e9b6df648fb4e036b676904e137f66d64f05334f54784c6a
|
|
| MD5 |
d528595dbb6fdf6276d63cf8c515bb83
|
|
| BLAKE2b-256 |
9220bdc9bae41e8f5acb3b2c3ff664622085c1452be7793cc35be123c931085c
|