Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattrasband/littlebird
Modern TwitterClient supporting the latest Python3.6+ features
https://github.com/mattrasband/littlebird
aiohttp asyncio python3-6 twitter
Last synced: about 1 month ago
JSON representation
Modern TwitterClient supporting the latest Python3.6+ features
- Host: GitHub
- URL: https://github.com/mattrasband/littlebird
- Owner: mattrasband
- License: mit
- Created: 2017-08-15T20:12:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-04-20T17:03:56.000Z (almost 4 years ago)
- Last Synced: 2024-11-07T00:31:02.955Z (3 months ago)
- Topics: aiohttp, asyncio, python3-6, twitter
- Language: Python
- Size: 37.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- License: LICENSE.txt
Awesome Lists containing this project
README
littlebird
==========.. image:: https://travis-ci.org/mrasband/littlebird.svg?branch=master
:target: https://travis-ci.org/mrasband/littlebird
.. image:: https://img.shields.io/pypi/v/nine.svg
:target: https://pypi.python.org/pypi/littlebirdLittleBird 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).
.. code:: python
import asyncio
import contextlibfrom littlebird import LittleBird
little_bird = LittleBird(
# 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))