Skip to main content

Pyrate is a python wrapper for restful web apis. It's like magic but quicker.

Project description

pyrate
======
Pyrate is a python wrapper for restful web apis. It's like *magic* but quicker.

Currently, the following services are implemented

* Twitter (v1.1 + OAuth)
* Mailchimp (v2)
* Harvest

Dependencies
------------
* [requests](http://python-requests.org)
* [requests_oauthlib](https://github.com/requests/requests-oauthlib)

Usage
-----
### Twitter
```
from pyrate.services import twitter

class myTwitterPyrate(twitter.TwitterPyrate):
oauth_consumer_key = ''
oauth_consumer_secret = ''

oauth_token = ''
oauth_token_secret = ''

h = myTwitterPyrate()
print h.do('account/verify_credentials')
print h.check_connection()
```
### Mailchimp
```
from pyrate.services import mailchimp

class myMailchimpPyrate(mailchimp.MailchimpPyrate):
api_key = ''

h = myMailchimpPyrate()
print h.do('helper/ping')
print h.check_connection()
```
### Harvest
```
from pyrate.services import harvest

class myHarvestPyrate(harvest.HarvestPyrate):
auth_user = ''
auth_pass = ''
organisation_name = ''

h = myHarvestPyrate()
print h.do('account/who_am_i')
print h.check_connection()
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyrate-0.2.0.tar.gz (4.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page