peerreach /

Filename Size Date modified Message
peerreach
tests
113 B
408 B
1.7 KB
176 B
56 B
1.4 KB

peerreach

peerreach is a python library to access the api from http://peerreach.com

For more infor about the api go to http://peerreach.com/api/overview

The last source code ant hte bugtracking is at http://bitbucket.org/ferranp/peerreach

Install

Install using pip:

pip install peerreach

or using easy_install:

easy_install peerreach

Usage

By now the api does not requre authentiation, so to use is:

import peerreach

api = peerreach.Api()

# lookup one user by screen name
userdata = api.lookup_user(screen_name="user")

# lookup one user by user_id
userdata = api.lookup_user(user_id=12345)

# lookup various users by screen name
usersdata = api.lookup_user(screen_names=("user1", "user2"))

# lookup various users by user_ids
usersdata = api.lookup_user(user_ids=(12345, 54321))

The data returned is a dictionary containing the data returned by the api. You can change the deserializer to get the raw api response or the response as an object:

import peerreach

# with raw data
api = peerreach.Api(parser=peerreach.RawPArser())
rawdata = api.lookup_user(screen_name="user")

# with object
api = peerreach.Api(parser=peerreach.ObjectPArser())
objectdata = api.lookup_user(screen_name="user")

Command Line

The package also includes a command line tool to test the api:

$ peerreach --help
Usage: peerreach [options] screen_name [screen_name...]

Options:
  --version   show program's version number and exit
  -h, --help  show this help message and exit
  -i, --ids   Use twitter ids instead of screen name
  -r, --raw   Show raw peerreach api output
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.