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
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. You can read more about the Graph API by accessing its official documentation.
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(open('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, 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["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. Bugs with the Graph API should be filed on Facebook’s bugtracker.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file facebook-sdk-0.4.0.tar.gz
.
File metadata
- Download URL: facebook-sdk-0.4.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a96c54d06213039dff1fe1fabc51972e394666cd6d83ea70f7c2e67472d9b72 |
|
MD5 | ac9f38e197e54b8ba9f3a61988cc33b7 |
|
BLAKE2b-256 | a1f7b7279ae7a32085276a742f03517d29c6c915de2d46ac6f1cc9307e7987e4 |