Asyncio Python client for Facebook API
Project description
aiofb
A thin asynchronous Python wrapper for Facebook graph API.
This library requires Python 3.5+
Installation
Using pip
$ pip install tarakimu
Basic usage
Example
import asyncio
import aiofb
# initialize Graph API
graph = aiofb.GraphAPI(access_token='YOUR_ACCESS_TOKEN')
async def get_something():
"""Makes a request to some-endpoint."""
return await graph.get('/{some-endpoint}')
# Get event loop
loop = asyncio.get_event_loop()
# Run it. Usually GraphAP methods return `aiohttp.ClientResponse` object
response = loop.run_until_complete(get_something())
# Get payload from response
payload = loop.run_until_complete(response.json())
More info about aiohttp.ClientResponse can be found at http://aiohttp.readthedocs.io/en/stable/client_reference.html#response-object
History
0.1.0 (2018-04-06)
Packege created.
0.1.1 (2018-05-17)
Clean up
First release on PyPI
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
aiofb-0.1.1.tar.gz
(15.1 kB
view hashes)
Built Distribution
Close
Hashes for aiofb-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 395e7303e1146ee8e7c5ef20be06a89db01aad96c45644fa3e21cd14eab7299c |
|
MD5 | 86a9312941a68f29a2055b6d6e5260a2 |
|
BLAKE2b-256 | 9cd0ff5267ae76c8f0a34427cc14954e498ae5b6560755d6a34891b57731d043 |