python-twitter
A Python wrapper around the Twitter API
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-twitteruv
uv add python-twitterpoetry
poetry add python-twitterInstalling 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
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
twitter-adsA Python SDK for managing Twitter Ads…
permissive · top 15,000 on PyPI
twythonTwython is a Python wrapper for the Twitter API…
permissive · top 15,000 on PyPI
python-youtubeA Python wrapper for the YouTube Data API V3…
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
twikitTwikit is a Twitter scraper library that lets…
permissive · top 15,000 on PyPI
requests-oauthAdds OAuth 1.0 authentication support to the…
permissive · top 5,000 on PyPI
ScweetScrape tweets, profiles, followers, and user…
permissive · top 15,000 on PyPI
twscrapetwscrape is an async Python library and CLI for…
permissive · top 15,000 on PyPI
requests-oauthlibAdds OAuth 1 and OAuth 2 authentication support…
permissive · top 1,000 on PyPI