twython
Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs
What it is and what it does
Twython is a pure Python wrapper around Twitter's REST and streaming APIs, designed to handle OAuth authentication (both OAuth 1 user auth and OAuth 2 app-only) and provide a simple interface to Twitter endpoints. It abstracts away the HTTP details and OAuth handshake, letting you call methods like `get_home_timeline()` or `update_status()` directly. The library maps keyword arguments to Twitter API parameters dynamically, so you can pass any query option the API supports without waiting for library updates.
The package depends on requests for HTTP calls and requests-oauthlib for OAuth token management. It supports image uploads (avatars, banners, status media) and includes a streaming API client for real-time tweet consumption. However, the project has been abandoned since mid-2021, with no active maintenance or updates to handle Twitter API changes or security issues.
Use it for:
- Build a web app where users sign in with Twitter and post to their timeline using OAuth 1 user authentication
- Create a bot or monitoring tool that reads tweets from a timeline or search endpoint using app-only OAuth 2
- Stream live tweets in real time to process or analyze them as they arrive
- Automate posting images or media to a Twitter account programmatically
- Query user profiles, follower lists, or tweet metadata for data collection or analytics
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Twython is a Python wrapper for the Twitter API that lets you query user data, timelines, direct messages, upload images, and access Twitter's streaming API using OAuth authentication.
No—unless you are maintaining legacy code already using Twython. The package is abandoned (last release 2021-07-16, no commits since), so it will not receive security updates or adapt to Twitter API changes. For new projects, use an actively maintained Twitter API client instead. If you must use it, audit the codebase for compatibility with current Twitter API versions and OAuth flows before deploying.
Install
twython on PyPI
pip
pip install twythonuv
uv add twythonpoetry
poetry add twythonInstalling twython
Before you install
Low install friction with only two runtime dependencies (requests and requests-oauthlib). However, the package is abandoned—last release was 2021-07-16, over 1855 days ago. Maintenance status is inactive, so security patches and API updates are unlikely.
License in practice
Licensed under MIT (permissive), so you can use, modify, and distribute Twython freely in commercial and private projects without significant legal restriction.
Quickstart
pip install twython
from twython import Twython
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
twitter.update_status(status='See how easy using Twython is!')
Requires Python 3.5 or later. You must obtain Twitter API credentials (Consumer Key, Consumer Secret, and OAuth tokens) from https://apps.twitter.com before authenticating.
Verify before relying
- Whether Twitter API endpoints have changed since the last release in 2021 and whether Twython still works with current Twitter API versions
- Current state of OAuth token handling and whether Twitter's authentication flow changes are reflected in the codebase
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — requests, requests-oauthlib |
| Maintenance | abandoned — 1,855 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,345/month — #11,956 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: twython-3.9.1-py3-none-any.whl
Keywords: twitter, search, api, tweet, twython, stream
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
python-twitterA Python wrapper that provides programmatic…
permissive · top 15,000 on PyPI
twikitTwikit is a Twitter scraper library that lets…
permissive · top 15,000 on PyPI
tweepyTweepy is a Python library that provides access…
permissive · top 5,000 on PyPI
rauthRauth provides OAuth 1.0/a and OAuth 2.0…
permissive · top 5,000 on PyPI
Mastodon.pyPython wrapper for the Mastodon API that lets…
permissive · top 15,000 on PyPI
twscrapetwscrape is an async Python library and CLI for…
permissive · top 15,000 on PyPI
ScweetScrape tweets, profiles, followers, and user…
permissive · top 15,000 on PyPI
twitchAPIA Python client library for the Twitch Helix…
permissive · top 15,000 on PyPI
requests-oauthAdds OAuth 1.0 authentication support to the…
permissive · top 5,000 on PyPI
pywaPyWa is a fully-typed Python framework for…
permissive · top 15,000 on PyPI