{"name":"Twython: A Pure Python Wrapper for the Twitter API","description":"Twython is an actively maintained, pure Python library designed to simplify interaction with the Twitter API. It provides comprehensive support for both normal and streaming Twitter APIs, making it easy to query user data, timelines, direct messages, and handle image uploads. This battle-tested wrapper is a robust solution for integrating Twitter functionalities into Python applications.","github":"https://github.com/ryanmcgrath/twython","url":"https://osrepos.com/repo/ryanmcgrath-twython","source":"osrepos.com","sourceDescription":"This repository profile is provided by osrepos.com, an open source repository discovery platform.","repositoryProfile":"https://osrepos.com/repo/ryanmcgrath-twython","generatedFor":"open source discovery and AI-assisted research","markdown":"https://osrepos.com/repo/ryanmcgrath-twython.md","json":"https://osrepos.com/repo/ryanmcgrath-twython.json","topics":["Python","Twitter API","Wrapper","Social Media","API Client","Open Source"],"keywords":["Python","Twitter API","Wrapper","Social Media","API Client","Open Source"],"stars":null,"summary":"Twython is an actively maintained, pure Python library designed to simplify interaction with the Twitter API. It provides comprehensive support for both normal and streaming Twitter APIs, making it easy to query user data, timelines, direct messages, and handle image uploads. This battle-tested wrapper is a robust solution for integrating Twitter functionalities into Python applications.","content":"## Introduction\n\nTwython is an actively maintained, pure Python wrapper for the Twitter API. It simplifies interaction with Twitter's extensive API, supporting both normal and streaming functionalities. This library is battle-tested by companies, educational institutions, and individuals, providing a robust solution for integrating Twitter features into your Python applications.\n\nKey features include querying user information, Twitter lists, timelines, and direct messages. It also supports image uploading for various purposes, OAuth 2 Application Only (read-only) authentication, and seamless Python 3 compatibility. The project is currently seeking new maintainers, offering a valuable opportunity to contribute to a widely used open-source project.\n\n## Installation\n\nInstalling Twython is straightforward using pip:\n\nbash\npip install twython\n\n\nFor legacy projects requiring Python 2.7 support, you can install the last compatible version:\n\nbash\npip install twython==3.7.0\n\n\nAlternatively, to install directly from the GitHub repository:\n\nbash\ngit clone git://github.com/ryanmcgrath/twython.git\ncd twython\npython setup.py install\n\n\n## Examples\n\nTo get started, you'll need to register an application on the Twitter Developer Platform to obtain your Consumer Key and Consumer Secret.\n\nFirst, import Twython:\n\npython\nfrom twython import Twython\n\nAPP_KEY = 'YOUR_APP_KEY'\nAPP_SECRET = 'YOUR_APP_SECRET'\nOAUTH_TOKEN = 'YOUR_OAUTH_TOKEN'\nOAUTH_TOKEN_SECRET = 'YOUR_OAUTH_TOKEN_SECRET'\n\ntwitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)\n\n\n**Fetching the Authenticated User's Home Timeline:**\n\npython\ntimeline = twitter.get_home_timeline()\nfor tweet in timeline:\n    print(f\"{tweet['user']['screen_name']}: {tweet['text']}\")\n\n\n**Updating User Status:**\n\npython\ntwitter.update_status(status='See how easy using Twython is!')\n\n\nFor detailed authentication flows, including OAuth 1 and OAuth 2, refer to the official documentation.\n\n## Why Use Twython?\n\nTwython stands out as a reliable choice for Twitter API integration due to several factors:\n\n*   **Pure Python:** Built entirely in Python, ensuring compatibility and ease of use within the Python ecosystem.\n*   **Active Maintenance:** The project is actively maintained, ensuring it keeps up with Twitter API changes and Python advancements.\n*   **Comprehensive API Coverage:** It supports a wide range of Twitter API endpoints, including the Streaming API, allowing for diverse application functionalities.\n*   **Flexibility:** Dynamic function arguments map directly to Twitter API parameters, providing flexibility without waiting for library updates.\n*   **Battle-Tested:** Proven in various real-world scenarios by a diverse user base.\n\n## Links\n\n*   **GitHub Repository:** [ryanmcgrath/twython](https://github.com/ryanmcgrath/twython){target=\"_blank\"}\n*   **Official Documentation:** [Twython Read the Docs](https://twython.readthedocs.io/en/latest/){target=\"_blank\"}\n*   **Twitter Developer Documentation:** [Twitter API Docs](https://developer.twitter.com/en/docs){target=\"_blank\"}\n*   **Twython on PyPI:** [Twython](https://pypi.python.org/pypi/twython){target=\"_blank\"}\n*   **Follow Ryan McGrath on Twitter:** [@ryanmcgrath](https://twitter.com/ryanmcgrath){target=\"_blank\"}\n*   **Follow Mike Helmick on Twitter:** [@mikehelmick](https://twitter.com/mikehelmick){target=\"_blank\"}","metrics":{"detailViews":0,"githubClicks":0},"dates":{"published":null,"modified":"2026-07-28T08:43:48.000Z"}}