skillfed

twython

Actively maintained, pure Python wrapper for the Twitter API. Supports both normal and streaming Twitter APIs

twython v3.9.1 122.3K downloads/30d#11,956 on PyPI1,861
Permissive license MIT Abandoned released

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 twython

uv

uv add twython

poetry

poetry add twython

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Topic :: Communications :: ChatTopic :: InternetTopic :: Software Development :: Libraries :: Python Modules

Tags

twitter api client pythontweet posting librarytwitter data retrievaloauth twitter authenticationtwitter streaming apitwitter api wrapperpython twitter integration
twitter-apioauthabandoned

More Python Modules packages