Registry / http-networking / xdk
library0.9.0pypypi✓ verified 80d ago

The official Python SDK for the X (formerly Twitter) API, currently at v0.9.0. Provides asynchronous and synchronous clients, OAuth 2.0 support, and wrappers for endpoints like tweets, users, media, and direct messages. Active development with monthly releases.

pip install xdk
INSTALL
IMPORT
SIG · XDK
X
xdk
http-networkingpythonv0.9.0
Install
4.2s avg
Import
Disk
34MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 35.4MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 4.2s · import 0.000s · 35MB
34MB installed
● package 34MB
Code
Verified usage

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

Client
from xdk import Client
from xdk import XClient

Initialize a synchronous client with OAuth 2.0 Bearer token and fetch the authenticated user's info.

import os from xdk import XClient from xdk.auth import OAuth2Bearer bearer_token = os.environ.get('X_BEARER_TOKEN', '') auth = OAuth2Bearer(token=bearer_token) client = XClient(auth=auth) # Get a user's info user = client.users.get_me() print(user)
Debug
Known issues
breakingIn v0.5.0, the client class was renamed from `X` to `XClient`. Old code using `from xdk import X` will break.
fix
Use `from xdk import XClient` instead.
affects: >=0.5.0
breakingIn v0.8.0, the `auth` parameter changed from accepting a tuple to requiring an Auth object. Passing `(bearer_token,)` no longer works.
fix
Create an `OAuth2Bearer` object and pass it as `auth=OAuth2Bearer(token=...)`.
affects: >=0.8.0
deprecatedThe `requests`-based fallback HTTP client is deprecated and will be removed in v1.0.0. Use `httpx` (the default).
fix
Ensure `httpx` is installed and do not force `use_requests=True`.
affects: >=0.4.0
gotchaAsync client methods must be awaited. Failing to `await` a coroutine will yield a warning or error.
fix
Always use `await client.some_method()` when using `AsyncXClient`.
affects: all
Upgrade
Version history
0.9.0latest on PyPI · released Feb 28, 2026
Audit
Dependencies
requestsoptionalUsed for synchronous HTTP requests (deprecated in favor of httpx).
httpxrequiredPrimary HTTP client for both sync and async operations.
Agent activity
56 hits · last 30 days
node
48
Amazon
1
OpenAI (training)
1
Resources
xdk — pip install xdk · libregistry