Skip to main content

This client library is designed to support the Facebook Graph API and the official Facebook JavaScript SDK, which is the canonical way to implement Facebook authentication.

Project description

Facebook Python SDK
====

This client library is designed to support the
[Facebook Graph API](http://developers.facebook.com/docs/api) and the official
[Facebook JavaScript SDK](http://github.com/facebook/connect-js), which is
the canonical way to implement Facebook authentication. You can read more
about the Graph API at [http://developers.facebook.com/docs/api](http://developers.facebook.com/docs/api).

Basic usage:

graph = facebook.GraphAPI(oauth_access_token)
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")
graph.put_object("me", "feed", message="I am writing on my wall!")

Photo uploads:

graph = facebook.GraphAPI(oauth_access_token)
tags = json.dumps([{'x':50, 'y':50, tag_uid:12345}, {'x':10, 'y':60, tag_text:'a turtle'}])
graph.put_photo('img.jpg', 'Look at this cool photo!', album_id_or_None, tags=tags)

If you are using the module within a web application with the
[JavaScript SDK](http://github.com/facebook/connect-js), you can also use the
module to use Facebook for login, parsing the cookie set by the JavaScript SDK
for logged in users. For example, in Google AppEngine, you could get the
profile of the logged in user with:

user = facebook.get_user_from_cookie(self.request.cookies, key, secret)
if user:
graph = facebook.GraphAPI(user["oauth_access_token"])
profile = graph.get_object("me")
friends = graph.get_connections("me", "friends")


You can see a full AppEngine example application in examples/appengine.

Reporting Issues
--------

If you have bugs or other issues specifically pertaining to this library, file
them [here](https://github.com/pythonforfacebook/facebook-sdk/issues). Bugs
with the Graph API should be filed on
[Facebook's bugtracker](https://developers.facebook.com/bugs/).

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

facebook-sdk-0.3.0.tar.gz (13.8 kB view details)

Uploaded Source

File details

Details for the file facebook-sdk-0.3.0.tar.gz.

File metadata

File hashes

Hashes for facebook-sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 687829348e0f9c0b9687b9b03e151a841d47f668c1d48649c672267f875acca0
MD5 25c38b4c6b20b07e8fc30236245d7af4
BLAKE2b-256 89afabb37a04122e18768a1a0a3fb16df41df2aa8f38983c9bd06c49bacf81fa

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