xapiweb 1.5.0__tar.gz → 1.5.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- xapiweb-1.5.2/PKG-INFO +103 -0
- xapiweb-1.5.2/README.md +96 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/pyproject.toml +2 -1
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/__init__.py +1 -1
- xapiweb-1.5.2/xapiweb.egg-info/PKG-INFO +103 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb.egg-info/SOURCES.txt +1 -0
- xapiweb-1.5.0/PKG-INFO +0 -5
- xapiweb-1.5.0/xapiweb.egg-info/PKG-INFO +0 -5
- {xapiweb-1.5.0 → xapiweb-1.5.2}/setup.cfg +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/_txn.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/client.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/errors.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/qids.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/__init__.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/_base.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/communities.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/dms.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/engagement.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/follows.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/lists.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/media.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/misc.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/moderation.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/notifications.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/settings.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/timelines.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/trends.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/tweets.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/resources/users.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/response.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/session.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb/tests/test_offline.py +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb.egg-info/dependency_links.txt +0 -0
- {xapiweb-1.5.0 → xapiweb-1.5.2}/xapiweb.egg-info/top_level.txt +0 -0
xapiweb-1.5.2/PKG-INFO
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xapiweb
|
|
3
|
+
Version: 1.5.2
|
|
4
|
+
Summary: Unified Python library for the X web API (stdlib only, 157 proven endpoints)
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# xapiweb
|
|
9
|
+
|
|
10
|
+
**xapiweb** is a zero-dependency Python client library for selected X web API operations. It provides one client, structured responses, resource modules, pacing, transaction IDs, verification for writes, and typed error handling.
|
|
11
|
+
|
|
12
|
+
> **Security:** This library uses a browser session supplied by the user. Never commit `my_data.json`, cookies, CSRF tokens, bearer tokens, or any other session material to GitHub or PyPI.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install xapiweb
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The package requires Python 3.8 or newer and has no runtime dependencies.
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
Create a private session file with your own X browser session, then:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from xapiweb import XClient
|
|
28
|
+
from xapiweb.resources.timelines import extract_tweets
|
|
29
|
+
|
|
30
|
+
x = XClient.from_session_file("my_data.json")
|
|
31
|
+
|
|
32
|
+
print(x.health().status) # 200 means the session is connected
|
|
33
|
+
print(x.me())
|
|
34
|
+
|
|
35
|
+
response = x.timelines.home(count=10)
|
|
36
|
+
for tweet in extract_tweets(response):
|
|
37
|
+
print(tweet["author"], tweet["text"][:80])
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
You can also pass credentials directly:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
x = XClient(cookie="<full-cookie>", csrf_token="<ct0-value>")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Keep credentials outside source control. The `xapiweb` distribution does not contain a live session file.
|
|
47
|
+
|
|
48
|
+
## Main capabilities
|
|
49
|
+
|
|
50
|
+
- Timelines, search, trends, users, notifications, lists, communities, and settings.
|
|
51
|
+
- Tweet reads, posts, replies, threads, polls, deletes, pins, and disclosures.
|
|
52
|
+
- Image and chunked video upload, media inspection, and downloads.
|
|
53
|
+
- Likes, reposts, bookmarks, follows, moderation, and direct-message operations.
|
|
54
|
+
- Structured `Response` objects with `.status`, `.data`, `.raw`, `.ok`, `.get()`, and `.summary()`.
|
|
55
|
+
- Pacing between requests, one retry for rate-limit responses, transaction ID handling, and write verification.
|
|
56
|
+
|
|
57
|
+
Operations with real-world side effects require explicit confirmation arguments where applicable. Use the library only with an account and session you are authorized to control, and respect X terms, rate limits, privacy requirements, and applicable law.
|
|
58
|
+
|
|
59
|
+
## Authentication guide
|
|
60
|
+
|
|
61
|
+
1. Sign in to `x.com` in a desktop browser.
|
|
62
|
+
2. In browser developer tools, copy the complete `Cookie` request header and the `x-csrf-token` request header.
|
|
63
|
+
3. Confirm that the `x-csrf-token` value matches the `ct0` cookie value.
|
|
64
|
+
4. Store the values in a local, private session file. Do not upload that file.
|
|
65
|
+
5. Run a low-cost health check before other operations.
|
|
66
|
+
|
|
67
|
+
See [`xapiweb/CONNECT_GUIDE.md`](xapiweb/CONNECT_GUIDE.md) for the detailed Sinhala guide.
|
|
68
|
+
|
|
69
|
+
## Response and errors
|
|
70
|
+
|
|
71
|
+
Every request returns a `Response` object. Common exceptions include `XAuthError`, `XRateLimitError`, `XTxnError`, `XValidationError`, `XApiError`, and `XVerifyError`. A successful HTTP acknowledgement does not always mean that a state-changing operation completed; write verification is enabled by default.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
The package includes offline tests that do not contact X:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python3 xapiweb/tests/test_offline.py
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The smoke and quickstart scripts require a private session file and live network access. Run them only with your own account and at a conservative request pace.
|
|
82
|
+
|
|
83
|
+
## Project layout
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
xapiweb/
|
|
87
|
+
├── xapiweb/ Python package and resource modules
|
|
88
|
+
├── examples/ Local setup and quickstart examples
|
|
89
|
+
├── docs/index.html Standalone black-and-white documentation page
|
|
90
|
+
├── pyproject.toml Build metadata
|
|
91
|
+
├── xapiweb_smoke_live.py Optional low-cost live health check
|
|
92
|
+
└── xapiweb_media_proof.py Optional self-cleaning media proof
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License and status
|
|
96
|
+
|
|
97
|
+
Review and add the license that applies to your project before publishing future releases. This library is an unofficial client and may require maintenance when X changes its web application or request contracts.
|
|
98
|
+
|
|
99
|
+
## Links
|
|
100
|
+
|
|
101
|
+
- [PyPI package](https://pypi.org/project/xapiweb/)
|
|
102
|
+
- [TestPyPI package](https://test.pypi.org/project/xapiweb/)
|
|
103
|
+
- [Standalone documentation](docs/index.html)
|
xapiweb-1.5.2/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# xapiweb
|
|
2
|
+
|
|
3
|
+
**xapiweb** is a zero-dependency Python client library for selected X web API operations. It provides one client, structured responses, resource modules, pacing, transaction IDs, verification for writes, and typed error handling.
|
|
4
|
+
|
|
5
|
+
> **Security:** This library uses a browser session supplied by the user. Never commit `my_data.json`, cookies, CSRF tokens, bearer tokens, or any other session material to GitHub or PyPI.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install xapiweb
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The package requires Python 3.8 or newer and has no runtime dependencies.
|
|
14
|
+
|
|
15
|
+
## Quick start
|
|
16
|
+
|
|
17
|
+
Create a private session file with your own X browser session, then:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from xapiweb import XClient
|
|
21
|
+
from xapiweb.resources.timelines import extract_tweets
|
|
22
|
+
|
|
23
|
+
x = XClient.from_session_file("my_data.json")
|
|
24
|
+
|
|
25
|
+
print(x.health().status) # 200 means the session is connected
|
|
26
|
+
print(x.me())
|
|
27
|
+
|
|
28
|
+
response = x.timelines.home(count=10)
|
|
29
|
+
for tweet in extract_tweets(response):
|
|
30
|
+
print(tweet["author"], tweet["text"][:80])
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
You can also pass credentials directly:
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
x = XClient(cookie="<full-cookie>", csrf_token="<ct0-value>")
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Keep credentials outside source control. The `xapiweb` distribution does not contain a live session file.
|
|
40
|
+
|
|
41
|
+
## Main capabilities
|
|
42
|
+
|
|
43
|
+
- Timelines, search, trends, users, notifications, lists, communities, and settings.
|
|
44
|
+
- Tweet reads, posts, replies, threads, polls, deletes, pins, and disclosures.
|
|
45
|
+
- Image and chunked video upload, media inspection, and downloads.
|
|
46
|
+
- Likes, reposts, bookmarks, follows, moderation, and direct-message operations.
|
|
47
|
+
- Structured `Response` objects with `.status`, `.data`, `.raw`, `.ok`, `.get()`, and `.summary()`.
|
|
48
|
+
- Pacing between requests, one retry for rate-limit responses, transaction ID handling, and write verification.
|
|
49
|
+
|
|
50
|
+
Operations with real-world side effects require explicit confirmation arguments where applicable. Use the library only with an account and session you are authorized to control, and respect X terms, rate limits, privacy requirements, and applicable law.
|
|
51
|
+
|
|
52
|
+
## Authentication guide
|
|
53
|
+
|
|
54
|
+
1. Sign in to `x.com` in a desktop browser.
|
|
55
|
+
2. In browser developer tools, copy the complete `Cookie` request header and the `x-csrf-token` request header.
|
|
56
|
+
3. Confirm that the `x-csrf-token` value matches the `ct0` cookie value.
|
|
57
|
+
4. Store the values in a local, private session file. Do not upload that file.
|
|
58
|
+
5. Run a low-cost health check before other operations.
|
|
59
|
+
|
|
60
|
+
See [`xapiweb/CONNECT_GUIDE.md`](xapiweb/CONNECT_GUIDE.md) for the detailed Sinhala guide.
|
|
61
|
+
|
|
62
|
+
## Response and errors
|
|
63
|
+
|
|
64
|
+
Every request returns a `Response` object. Common exceptions include `XAuthError`, `XRateLimitError`, `XTxnError`, `XValidationError`, `XApiError`, and `XVerifyError`. A successful HTTP acknowledgement does not always mean that a state-changing operation completed; write verification is enabled by default.
|
|
65
|
+
|
|
66
|
+
## Tests
|
|
67
|
+
|
|
68
|
+
The package includes offline tests that do not contact X:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
python3 xapiweb/tests/test_offline.py
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The smoke and quickstart scripts require a private session file and live network access. Run them only with your own account and at a conservative request pace.
|
|
75
|
+
|
|
76
|
+
## Project layout
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
xapiweb/
|
|
80
|
+
├── xapiweb/ Python package and resource modules
|
|
81
|
+
├── examples/ Local setup and quickstart examples
|
|
82
|
+
├── docs/index.html Standalone black-and-white documentation page
|
|
83
|
+
├── pyproject.toml Build metadata
|
|
84
|
+
├── xapiweb_smoke_live.py Optional low-cost live health check
|
|
85
|
+
└── xapiweb_media_proof.py Optional self-cleaning media proof
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## License and status
|
|
89
|
+
|
|
90
|
+
Review and add the license that applies to your project before publishing future releases. This library is an unofficial client and may require maintenance when X changes its web application or request contracts.
|
|
91
|
+
|
|
92
|
+
## Links
|
|
93
|
+
|
|
94
|
+
- [PyPI package](https://pypi.org/project/xapiweb/)
|
|
95
|
+
- [TestPyPI package](https://test.pypi.org/project/xapiweb/)
|
|
96
|
+
- [Standalone documentation](docs/index.html)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: xapiweb
|
|
3
|
+
Version: 1.5.2
|
|
4
|
+
Summary: Unified Python library for the X web API (stdlib only, 157 proven endpoints)
|
|
5
|
+
Requires-Python: >=3.8
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
|
|
8
|
+
# xapiweb
|
|
9
|
+
|
|
10
|
+
**xapiweb** is a zero-dependency Python client library for selected X web API operations. It provides one client, structured responses, resource modules, pacing, transaction IDs, verification for writes, and typed error handling.
|
|
11
|
+
|
|
12
|
+
> **Security:** This library uses a browser session supplied by the user. Never commit `my_data.json`, cookies, CSRF tokens, bearer tokens, or any other session material to GitHub or PyPI.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install xapiweb
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
The package requires Python 3.8 or newer and has no runtime dependencies.
|
|
21
|
+
|
|
22
|
+
## Quick start
|
|
23
|
+
|
|
24
|
+
Create a private session file with your own X browser session, then:
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
from xapiweb import XClient
|
|
28
|
+
from xapiweb.resources.timelines import extract_tweets
|
|
29
|
+
|
|
30
|
+
x = XClient.from_session_file("my_data.json")
|
|
31
|
+
|
|
32
|
+
print(x.health().status) # 200 means the session is connected
|
|
33
|
+
print(x.me())
|
|
34
|
+
|
|
35
|
+
response = x.timelines.home(count=10)
|
|
36
|
+
for tweet in extract_tweets(response):
|
|
37
|
+
print(tweet["author"], tweet["text"][:80])
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
You can also pass credentials directly:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
x = XClient(cookie="<full-cookie>", csrf_token="<ct0-value>")
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Keep credentials outside source control. The `xapiweb` distribution does not contain a live session file.
|
|
47
|
+
|
|
48
|
+
## Main capabilities
|
|
49
|
+
|
|
50
|
+
- Timelines, search, trends, users, notifications, lists, communities, and settings.
|
|
51
|
+
- Tweet reads, posts, replies, threads, polls, deletes, pins, and disclosures.
|
|
52
|
+
- Image and chunked video upload, media inspection, and downloads.
|
|
53
|
+
- Likes, reposts, bookmarks, follows, moderation, and direct-message operations.
|
|
54
|
+
- Structured `Response` objects with `.status`, `.data`, `.raw`, `.ok`, `.get()`, and `.summary()`.
|
|
55
|
+
- Pacing between requests, one retry for rate-limit responses, transaction ID handling, and write verification.
|
|
56
|
+
|
|
57
|
+
Operations with real-world side effects require explicit confirmation arguments where applicable. Use the library only with an account and session you are authorized to control, and respect X terms, rate limits, privacy requirements, and applicable law.
|
|
58
|
+
|
|
59
|
+
## Authentication guide
|
|
60
|
+
|
|
61
|
+
1. Sign in to `x.com` in a desktop browser.
|
|
62
|
+
2. In browser developer tools, copy the complete `Cookie` request header and the `x-csrf-token` request header.
|
|
63
|
+
3. Confirm that the `x-csrf-token` value matches the `ct0` cookie value.
|
|
64
|
+
4. Store the values in a local, private session file. Do not upload that file.
|
|
65
|
+
5. Run a low-cost health check before other operations.
|
|
66
|
+
|
|
67
|
+
See [`xapiweb/CONNECT_GUIDE.md`](xapiweb/CONNECT_GUIDE.md) for the detailed Sinhala guide.
|
|
68
|
+
|
|
69
|
+
## Response and errors
|
|
70
|
+
|
|
71
|
+
Every request returns a `Response` object. Common exceptions include `XAuthError`, `XRateLimitError`, `XTxnError`, `XValidationError`, `XApiError`, and `XVerifyError`. A successful HTTP acknowledgement does not always mean that a state-changing operation completed; write verification is enabled by default.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
The package includes offline tests that do not contact X:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python3 xapiweb/tests/test_offline.py
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
The smoke and quickstart scripts require a private session file and live network access. Run them only with your own account and at a conservative request pace.
|
|
82
|
+
|
|
83
|
+
## Project layout
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
xapiweb/
|
|
87
|
+
├── xapiweb/ Python package and resource modules
|
|
88
|
+
├── examples/ Local setup and quickstart examples
|
|
89
|
+
├── docs/index.html Standalone black-and-white documentation page
|
|
90
|
+
├── pyproject.toml Build metadata
|
|
91
|
+
├── xapiweb_smoke_live.py Optional low-cost live health check
|
|
92
|
+
└── xapiweb_media_proof.py Optional self-cleaning media proof
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## License and status
|
|
96
|
+
|
|
97
|
+
Review and add the license that applies to your project before publishing future releases. This library is an unofficial client and may require maintenance when X changes its web application or request contracts.
|
|
98
|
+
|
|
99
|
+
## Links
|
|
100
|
+
|
|
101
|
+
- [PyPI package](https://pypi.org/project/xapiweb/)
|
|
102
|
+
- [TestPyPI package](https://test.pypi.org/project/xapiweb/)
|
|
103
|
+
- [Standalone documentation](docs/index.html)
|
xapiweb-1.5.0/PKG-INFO
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|