Skip to main content

Easy REST api wrapper

Project description

Introduction

An example for accessing google maps rest api using rieapie.

import rieapie
gmap = rieapie.Api("http://maps.googleapis.com/maps/api")
args = {
 "origin"      : "Toronto"
,"destination" : "Montreal"
,"avoid"       : "highways"
,"mode"        : "bicycling"
,"sensor"      : "false"
}
directions = gmap.directions.json.get(**args)
print directions["routes"][0]["bounds"]

An example for accessing the twitter api with the provided twitter wrapper.

import rieapie
params = {
 "consumer_key"    : "..."
,"consumer_secret" : "..."
}
# or if you want to provide an access token
params = {
 "consumer_key"        : "..."
,"consumer_secret"     : "..."
,"access_token"        : "..",
,"access_token_secret" : ".."
}

twitter = rieapie.wrappers.Twitter( **params )

timeline = twitter.statuses.user_timeline(ext="json")
# or if you prefer this syntax
timeline = twitter.statuses["user_timeline.json"]
for status in timeline.get(count=10, screen_name="mybestfriend"):
    print status['text']

why is it ‘rieapie’?

  • [R]est [i]s [E]asy [a]s [P]ython [i]s [E]asy
  • [R]est [i]s [E]asy [a]s [PIE]
  • [R]est [i]s [E]asy [API]… [E]asy

Project details


Download files

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

Files for rieapie, version 0.0.7.3
Filename, size File type Python version Upload date Hashes
Filename, size rieapie-0.0.7.3-py2.7.egg (10.3 kB) File type Egg Python version 2.7 Upload date Hashes View
Filename, size rieapie-0.0.7.3.tar.gz (5.2 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page