Lenny Domnitser’s

⇙ Jump to content


This is a static archive of the domnit.org blog,
which Lenny Domnitser wrote between 2006 and 2009.

Tiny Python Facebook library

As promised,


It needs Python and simplejson. Here’s how you use it:

>>> import tinyface
>>> app = tinyface.App('...', '...')
>>> session = app.rpc('auth.getSession', auth_token='...')
>>> app.rpc('users.getInfo', uids='8112822',
[{u'first_name': u'Lenny', u'uid': 8112822}]
>>> my_events = app.fql('''select name from event
                where eid in (select eid from event_member
                where uid = 8112822)''',

It just provides two methods, rpc and fql. The latter is a shortcut for FQL. However, all Facebook API calls, including FQL, can be made through rpc, which takes the method name and any parameters. method, api_key, v, call_id, format, and sig are put in automatically by the code, so the caller has to provide any parameters besides those.

Simple, huh? It’s BSD-licensed. You can use it as a module or just drop it into a script.