Skip to main content

Full-featured, lightweight Facebook API wrapper for Graph & FQL.

Project description

=======
pyfaceb
=======

Introduction
------------

This python library was started because most of the existing libraries
out there are either no longer in development, use the old REST API, or
are lacking in support of the more advanced features available, such as
batch querying and FQL support.

Purpose
-------

1. to provide a lightweight, easy to use Python wrapper for the Facebook
Graph API and Facebook Query Language (FQL) interface.

2. to provide a nice API to Facebook's batch query interface.

3. to make it easy to use multiple access tokens, where appropriate /
necessary.

Basic Usage Examples
--------------------

fbg = FBGraph('access-token')

me = fbg.get('me')

# prints your first name
print me['first_name']

# prints out the name of all your likes
my_likes = fbg.get('me/likes')
for like in my_likes['data']:
print like['name']

# make a request with parameters...
my_first_3_likes = fbg.get('me/likes', {'limit': 3})

# get an object by it's ID #:
facebook_platform_page = fbg.get('19292868552')

Batched Query Examples
----------------------

# batched queries with a single access token
fbg = FBGraph('access-token')

# you can write it manually if you like...
results = fbg.batch([
{'method': 'GET', 'relative_url': 'me'},
{'method': 'GET', 'relative_url': 'me/friends?limit=50'}
])

# or use the GetRequestFactory
batch = [GetRequestFactory('me'), GetRequestFactory('me/friends', limit=50)]
fbg.batch(batch)

# If you need to use multiple access tokens in
# one batch call, you can!
# Note, you still must specify a "fallback" token when you create an
# instance of FBGraph()
fbg.batch([
GetRequestFactory('PAGE1_FB_OBJ_ID', access_token=PAGE1_ACCESS_TOKEN),
GetRequestFactory('PAGE2_FB_OBJ_ID', access_token=PAGE2_ACCESS_TOKEN),
GetRequestFactory('PAGE3_FB_OBJ_ID', access_token=PAGE3_ACCESS_TOKEN),
])

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

pyfaceb-0.2.4.tar.gz (6.8 kB view details)

Uploaded Source

File details

Details for the file pyfaceb-0.2.4.tar.gz.

File metadata

  • Download URL: pyfaceb-0.2.4.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyfaceb-0.2.4.tar.gz
Algorithm Hash digest
SHA256 3ca8ea954320562a4169d9d328d293a706cdf1f801ef730245e687a47eea1fdb
MD5 bea7e57283878b2b5c6dcf8729e1fe7f
BLAKE2b-256 2452fd9e21b0b223d80a7e4af3b52e11c14a643f1cbcfa5bf70c39dbe6f7bc53

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