Skip to main content

Asyncio Python client for Facebook API

Project description

aiofb

https://img.shields.io/pypi/v/aiofb.svg https://img.shields.io/travis/tehamalab/aiofb.svg Documentation Status

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)

Uploaded Source

Built Distribution

aiofb-0.1.1-py2.py3-none-any.whl (5.8 kB view hashes)

Uploaded Python 2 Python 3

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