Skip to main content

Asyncronous twitter client library

Project description

LittleBird is a Python 3.6+ asynchronous library for accessing twitter utilizing new python features: async generators, type hinting, etc.

Usage

Currently only the oauth1 methods are supported (application only authentication, user account access).

import asyncio
import contextlib

from littlebird import LittleBird
from littlebird.web import OAuth1HttpClient

little_bird = LittleBird(OAuth1HttpClient(
    # required for oauth1 signing:
    consumer_key: str,
    consumer_secret: str,
    # optionally necessary for endpoints requiring a user's scope:
    access_token: Optional[str] = None,
    access_token_secret: Optional[str] = None
))

async def main(little_bird):
    # watch the random sampling of tweets chosen by twitter
    async for tweet in little_bird.sample():
        print(tweet)

if __name__ == '__main__':
    loop = asyncio.get_event_loop()
    with contextlib.suppress(KeyboardInterrupt):
        loop.run_until_complete(main(little_bird))

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

littlebird-0.0.0a1.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file littlebird-0.0.0a1.tar.gz.

File metadata

File hashes

Hashes for littlebird-0.0.0a1.tar.gz
Algorithm Hash digest
SHA256 aa6af6bd089e11eb4f5b65a34492bfbdd072d4ebd1be5c05978b6992c6a67abc
MD5 ba1637903ae1264e21ea0a0f0a7721f0
BLAKE2b-256 e8550b84f3aaa87f6546a5deaacdabd6186833e403c1af19c5effe543de7256b

See more details on using hashes here.

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