All Projects → eventbrite → facebook-py-sdk

eventbrite / facebook-py-sdk

Licence: MIT License
Facebook Python SDK

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to facebook-py-sdk

facebook-node-sdk
Modeled from the (Facebook Javascript SDK), now with the facebook-node-sdk you can now easily write the same code and share between your server (nodejs) and the client (Facebook Javascript SDK).
Stars: ✭ 519 (+3360%)
Mutual labels:  facebook, facebook-sdk, facebook-graph-api, facebook-api
Facebook-Auto-Pilot
Automate common Facebook activities such as posting to groups and pages walls. Effortlessly post to multiple groups or pages.
Stars: ✭ 126 (+740%)
Mutual labels:  facebook, facebook-sdk, facebook-graph-api, facebook-api
facebook-go-sdk
A very simple and easy-to-use Facebook SDK for Golang.
Stars: ✭ 18 (+20%)
Mutual labels:  facebook, facebook-sdk, facebook-graph-api, facebook-api
facebook-ruby-ads-sdk
The Facebook Marketing API in Ruby.
Stars: ✭ 59 (+293.33%)
Mutual labels:  facebook, facebook-graph-api, facebook-api
PHP-SDK-3.0---Graph-API-base-Facebook-Connect-Tutorial-Source
PHP SDK 3.0 Graph API base Facebook Connect Library
Stars: ✭ 60 (+300%)
Mutual labels:  facebook-sdk, facebook-graph-api, facebook-api
Facebooktoolkit
a tool to get Facebook data, and some Facebook bots, and extra tools found on Facebook Toolkit ++.
Stars: ✭ 227 (+1413.33%)
Mutual labels:  facebook, facebook-api
Facebook Sdk
Python SDK for Facebook's Graph API
Stars: ✭ 2,626 (+17406.67%)
Mutual labels:  facebook, facebook-sdk
Facebook-Album-Browser
jQuery plugin for browsing public albums of a Facebook account
Stars: ✭ 76 (+406.67%)
Mutual labels:  facebook, facebook-api
facebook-data-extraction
Experiences in extracting data from Facebook with these 3 methods: Facebook Graph API, Automation tools, DevTools Console
Stars: ✭ 81 (+440%)
Mutual labels:  facebook, facebook-graph-api
facebook-bot-autoresponder
Facebook bot that automatically responds to the comments of a certain post
Stars: ✭ 90 (+500%)
Mutual labels:  facebook, facebook-api
facebook-messenger
Go (GoLang) package for Facebook Messenger API and Chat bot
Stars: ✭ 62 (+313.33%)
Mutual labels:  facebook, facebook-api
facebook-login-for-robots
Facebook Login for 🤖 robots
Stars: ✭ 41 (+173.33%)
Mutual labels:  facebook, facebook-api
Facebookimagepicker
FacebookImagePicker is Facebook album photo picker written in Swift.
Stars: ✭ 220 (+1366.67%)
Mutual labels:  facebook, facebook-api
J2team Community
Join our group to see more
Stars: ✭ 172 (+1046.67%)
Mutual labels:  facebook, facebook-api
Facebook Js Ads Sdk
[DEPRECATED] OFFICIAL FACEBOOK SDK: https://github.com/facebook/facebook-nodejs-ads-sdk
Stars: ✭ 140 (+833.33%)
Mutual labels:  facebook, facebook-api
Facebook
📨 Facebook Notifications Channel for Laravel
Stars: ✭ 120 (+700%)
Mutual labels:  facebook, facebook-api
Docker Multistreamer
Dockerized multistreamer
Stars: ✭ 90 (+500%)
Mutual labels:  facebook, facebook-api
Facebook Export
Tools to help administer your Facebook groups
Stars: ✭ 96 (+540%)
Mutual labels:  facebook, facebook-api
lambda-facebook-oauth
An AWS Lambda function to facilitate Oauth2 social login with Facebook
Stars: ✭ 16 (+6.67%)
Mutual labels:  facebook, facebook-api
FacebookGraphAPI-Examples
Examples for facebook graph api for python
Stars: ✭ 38 (+153.33%)
Mutual labels:  facebook, facebook-graph-api

Facebook SDK Python

https://travis-ci.org/eventbrite/facebook-py-sdk.svg?branch=master

Facebook SDK Python is a python based implementation of Facebook PHP SDK

Installation

To install Facebook SDK Python, simply:

$ pip install facebook-py-sdk

Usage

Retrieve User Profile

from facebook_sdk.exceptions import FacebookResponseException
from facebook_sdk.facebook import Facebook

facebook = Facebook(
    app_id='{app_id}',
    app_secret='{app_secret}',
    default_graph_version='v2.12',
)

facebook.set_default_access_token(access_token='{access_token}')

try:
    response = facebook.get(endpoint='/me?fields=id,name')
except FacebookResponseException as e:
    print(e.message)
else:
    print('User id: %(name)s' % {'name': response.json_body.get('id')})
    print('User name: %(name)s' % {'name': response.json_body.get('name')})

Batch Upload Files

from facebook_sdk.exceptions import FacebookResponseException
from facebook_sdk.facebook import Facebook

facebook = Facebook(
    app_id='{app_id}',
    app_secret='{app_secret}',
)

facebook.set_default_access_token(access_token='{access_token}')

batch = {
    'photo-one': facebook.request(
        endpoint='/me/photos',
        params={
            'message': 'Foo photo.',
            'source': facebook.file_to_upload('path/to/foo.jpg'),
        },
    ),
    'photo-two': facebook.request(
        endpoint='/me/photos',
        params={
            'message': 'Bar photo.',
            'source': facebook.file_to_upload('path/to/bar.jpg'),
        },
    ),
    'photo-three': facebook.request(
        endpoint='/me/photos',
        params={
            'message': 'Other photo.',
            'source': facebook.file_to_upload('path/to/other.jpg'),
        },
    )
}

try:
    responses = facebook.send_batch_request(requests=batch)
except FacebookResponseException as e:
    print(e.message)

Dependencies

Dependencies that to use the application:

Contributing

Please use github model by forking the repository and making Pull Requests.

Running tests

➜  facebook-python-sdk $ pip install -e .[testing]
➜  facebook-python-sdk $ pytest
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].