Registry / communication / python-twitter

python-twitter

JSON →
library3.5pypypi✓ verified 35d ago

A Python wrapper around the Twitter API. Version 3.5 fixes DM endpoint handling. Release cadence is sporadic.

communicationhttp-networking
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Wrong: Api is exposed at the top-level package, not submodule.

from twitter import Api

Authenticate and post a tweet.

from twitter import Api consumer_key = os.environ.get('TWITTER_CONSUMER_KEY', '') consumer_secret = os.environ.get('TWITTER_CONSUMER_SECRET', '') access_token_key = os.environ.get('TWITTER_ACCESS_TOKEN_KEY', '') access_token_secret = os.environ.get('TWITTER_ACCESS_TOKEN_SECRET', '') api = Api(consumer_key, consumer_secret, access_token_key, access_token_secret) status = api.PostUpdate('Hello world!') print(status.text)
Debug
Known footguns
breakingIn v3.0+, Python 2 support was dropped. Ensure you are using Python 3.
deprecatedApi.PostMedia() is deprecated and will be removed in a future version. Use Api.PostUpdate() with media parameter instead.
gotchaThe library previously used a different OAuth flow. Make sure you are using the correct set of keys (API key, API secret key, Access token, Access token secret).
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources