skillfed

python-twitter

A Python wrapper around the Twitter API

python-twitter v3.5 115.9K downloads/30d#12,233 on PyPI3,402
Permissive license Apache License 2.0 Abandoned released

What it is and what it does

python-twitter is a pure Python client library that wraps Twitter's REST API, allowing you to authenticate via OAuth and interact with Twitter data without writing raw HTTP requests. It models Twitter entities (users, statuses, trends, direct messages, etc.) as Python objects and exposes them through an Api class with methods like GetUserTimeline, PostUpdate, GetFriends, and VerifyCredentials.

The library handles OAuth token management and request signing through its dependencies on requests and requests-oauthlib, abstracting away authentication complexity. It was designed to work with Python 2.7 and Python 3, though it has not been actively maintained since 2018 and the repository is now archived. For new projects, you should verify whether it still aligns with Twitter's current API surface and whether the maintainers will address breaking changes.

Use it for:

  • Fetch a user's tweet timeline or search results and analyze tweet text, metadata, or engagement metrics.
  • Post tweets, retweets, or replies programmatically from a Python application or bot.
  • Retrieve user profile information, follower lists, or friend networks for social graph analysis.
  • Monitor trends or hashtags by polling Twitter's trending endpoints and storing results in a database.
  • Build a Twitter integration layer in a Django or Flask web application using the library's data models.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

A Python wrapper that provides programmatic access to the Twitter API, handling OAuth authentication and exposing Twitter data models (users, statuses, trends, etc.) through a high-level interface.

No, not for new projects. The repository is archived, the last release was in 2018, and there is no active maintenance. Twitter's API has evolved significantly since then, and the library will not be updated to handle breaking changes or new endpoints. Install only if you are maintaining legacy code that already depends on it and you have verified it still works with your target Twitter API version.

Install

python-twitter on PyPI

pip

pip install python-twitter

uv

uv add python-twitter

poetry

poetry add python-twitter

Installing python-twitter

Before you install

Low install friction with three straightforward dependencies (future, requests, requests-oauthlib). However, the repository is archived and abandoned—the last release was in 2018 and the last commit in 2024 shows no active maintenance. Use only if you accept that bugs and API changes will not be addressed.

License in practice

Licensed under Apache License 2.0 (permissive). You may use, modify, and distribute the code freely in commercial and private projects, provided you include a copy of the license and state significant changes.

Quickstart

pip install python-twitter

import twitter
api = twitter.Api(consumer_key='key',
                  consumer_secret='secret',
                  access_token_key='token',
                  access_token_secret='token_secret')
statuses = api.GetUserTimeline(screen_name='username')
print([s.text for s in statuses])

You must obtain OAuth credentials from Twitter's developer portal and register an application before any API calls will succeed.

Verify before relying

  • Whether the library still works with current Twitter API v2 endpoints or is limited to deprecated v1.1 endpoints.
  • Current compatibility with modern Python versions beyond 3.6, given the package's age and lack of recent testing.
  • Whether Twitter's API changes since 2018 have broken undocumented functionality in the library.

Package facts

License Apache License 2.0 (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — future, requests, requests-oauthlib
Maintenance abandoned — 2,841 days since the last release
Last repo commit (repository archived)
First released
Downloads 115,889/month — #12,233 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: python_twitter-3.5-py2.py3-none-any.whl

Keywords: twitter, api

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.6Topic :: Communications :: ChatTopic :: InternetTopic :: Software Development :: Libraries :: Python Modules

Tags

twitter api python wrapperpost tweets programmaticallyfetch twitter data pythontwitter oauth authenticationtwitter timeline apitwitter user data pythonsocial media api client
twitter-apioautharchived

More Python Modules packages