Skip to main content

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

Project description

Latest PyPI version Number of PyPI downloads

Pyrate is a python wrapper for restful web apis. It’s like magic but simpler.

Currently, the following services are implemented

  • Twitter (v1.1 + OAuth)

  • Mailchimp (v2)

  • Harvest

  • Github

There’s a quick-start guide below, for full documentation (WIP) visit: http://pyrate.readthedocs.org/en/latest/

Dependencies

Install

# so simple
pip install pyrate

Quick Start

Twitter

from pyrate.services import twitter

h = twitter.TwitterPyrate('oauth_consumer_key', 'oauth_consumer_secret',
                          'oauth_token', 'oauth_token_secret')

print(h.do('account/verify_credentials'))
print(h.check_connection())
print(h.tweet("This is awesome!"))

Mailchimp

from pyrate.services import mailchimp

h = mailchimp.MailchimpPyrate('apikey')

print(h.do('helper/ping'))
print(h.check_connection())
print(h.subscribeToList('ListName', 'myemail@example.com'))
print(h.unsubscribeFromList('ListName', 'myemail@example.com'))

Harvest

from pyrate.services import harvest

h = harvest.HarvestPyrate('user', 'password', 'organisation')

print(h.do('account/who_am_i'))
print(h.check_connection())

Github

from pyrate.services import github

h = github.GithubPyrate('user', 'password')

print(h.do('#'))
print(h.check_connection())
h.create_repo('name', 'description', private=True)
h.create_repo('name', 'description', 'organisation')
h.delete_repo('name')

Todos

  • Create more “convenience”-methods (like h.tweet("This is awesome!"))

  • Implement CLI-Interface (see branch cli-interface

  • Add more services (Open for suggestions!)

  • Create Documentation

  • lots and lots more

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.3.6.tar.gz (10.9 kB view details)

Uploaded Source

File details

Details for the file pyrate-0.3.6.tar.gz.

File metadata

  • Download URL: pyrate-0.3.6.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyrate-0.3.6.tar.gz
Algorithm Hash digest
SHA256 77ba5c82dd69edfcd44c39169873e637bb1c44135a980f042a61c1b3a66e5f26
MD5 9774420663f3f2b95b9e949f4bc9eabe
BLAKE2b-256 6657ae098e155a065440eca9a2148700f19cdace07e0e2aaa3eb3ba388019b73

See more details on using hashes here.

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