Facebook SDK Python
Facebook SDK Python is a python based implementation of Facebook PHP SDK
Installation
To install Facebook SDK Python, simply:
$ pip install facebook-sdk-python
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.5',
)
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 name: %(name)s' % {'name': response.json_body.get('id')}
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:
Metadata
Release files for facebook-sdk-python 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| facebook-sdk-python-0.0.4.tar.gz | 9.2 kB | Without provenance | Details for facebook-sdk-python-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| facebook_sdk_python-0.0.4-py2-none-any.whl | Python 2 | none | any | Details for facebook_sdk_python-0.0.4-py2-none-any.whl |
Total release size: 23.2 kB
Release files / facebook-sdk-python-0.0.4.tar.gz
| Download URL | facebook-sdk-python-0.0.4.tar.gz |
|---|---|
| Size | 9.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bda0b7d64d206055ec7d5333159ce036625f49be5c70e4b9d6c56b74dde564fd
|
|
BLAKE2b-256 checksum How to use checksums |
cf8b7a806d564b200989632cab1b79b59a6a14adbcabe804bbe3326e90e307a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / facebook_sdk_python-0.0.4-py2-none-any.whl
| Download URL | facebook_sdk_python-0.0.4-py2-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
115be61575696321652258e0dfa2cd78070bc59af0e99e81bbd1961ed17ecd3e
|
|
BLAKE2b-256 checksum How to use checksums |
6b11ab952ead1586b2608ed1fb08dbc79da56f45d0ea2e9fbc7a7ec21517a24f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for facebook-sdk-python 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.