Not Logged In

pyoneall 0.2.3

OneAll (http://www.oneall.com) provides web-applications with a unified API for 30+ social networks.
pyoneall provides developers with OneAll accounts a simple interface with the OneAll API for Python-based web-applications.

So far, we have tested pyoneall within Flask and Django apps. To use OneAll as a Django authentication backend,
please check out our django_oneall project, which relies on this package.

pyoneall defines the OneAll class, which is the API client. As of now, it has the following methods:

connections():

Get a list of social connections to the site

connection():

Get detailed connection data including user details

users():

Get a list of users that have connected with the site

user():

Get detailed user data

user_contacts():

Get a list of user’s contacts

publish():

Publish a message using user’s social network account

As pyoneall wraps a REST API which returns JSON objects, the objects returned by the methods behave in a somewhat
JavaScript-like manner. This means that in addition to the dict-style object['key'] notation, you can also
use object.key.

Also, arrays nested in the JSON responses, are represented by a class that defines a by_*() grouping and searching
method in an addition to the list methods it inherits from.

For more information on these classes, check out help(pyoneall.base.OADict) and help(pyoneall.base.OAList).

Example

Authentication

Access to the OneAll API requires authentication. Obtain your API credentials following the procedure described at
Authentication Documentation.

OneAll uses pagination for calls which contain many entries. Each call returns a page up to 500 entries. When the
OneAll.connections() method is executed without arguments, only the first page is loaded. You the access the
pagination information in connections.pagination.

In the example above, you can see that some connections were made with the callback of the desktop website
(http://www.example.com/connect/), and some were made with the mobile webapp (http://m.example.com/connect/).
We can get an object grouped by the “callback_uri” using:

Or, alternatively you can fetch the connection details through the connection() method of an entry in the list
of connections:

some_connection = connections.entries[3].connection()

some_connection will now contain the “connection” portion of the response described in the API documentation for
Read Connection Details, most importantly some_connection.user and some_connection.user.user_token

The User API

Fetching user list

OneAll.users() behaves the same way OneAll.connections() does, arguments and all. This is due to the similarity
of the List Users and the List Connections API, in terms of pagination and entries structure.

users = oa.users()

Now, you can access users.entries, or even access detailed user data with users.entries[4].user().