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.

Source Distribution

rieapie-0.0.7.3.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

rieapie-0.0.7.3-py2.7.egg (10.3 kB view details)

Uploaded Source

File details

Details for the file rieapie-0.0.7.3.tar.gz.

File metadata

  • Download URL: rieapie-0.0.7.3.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rieapie-0.0.7.3.tar.gz
Algorithm Hash digest
SHA256 586f389d8e98a3f101778941189e7cf10b4427542c17c6db23eeae8bd05efbe9
MD5 2df8ddd704666b5c25712cef2123b524
BLAKE2b-256 0565e415ebfa401763ac5a83688d9f95daafcc9ff9969b19cfabb93d8c0d3242

See more details on using hashes here.

File details

Details for the file rieapie-0.0.7.3-py2.7.egg.

File metadata

File hashes

Hashes for rieapie-0.0.7.3-py2.7.egg
Algorithm Hash digest
SHA256 6296411cd859df0b1cdc5b8bef273fcce363b96d0477c078a0fdbbba7150a9a1
MD5 dff14265d85ba2c0ebb4a08b906d7696
BLAKE2b-256 1ddf0d77b6376776112b7ad80ee34460b0448ca4c8dd515923a2bc1c97787bcf

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