tweetapi 2.0.0__tar.gz → 2.2.0__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.
Files changed (23) hide show
  1. {tweetapi-2.0.0 → tweetapi-2.2.0}/PKG-INFO +6 -2
  2. {tweetapi-2.0.0 → tweetapi-2.2.0}/README.md +4 -0
  3. {tweetapi-2.0.0 → tweetapi-2.2.0}/pyproject.toml +1 -1
  4. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/__init__.py +1 -1
  5. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/profile.py +13 -1
  6. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/types.py +17 -0
  7. {tweetapi-2.0.0 → tweetapi-2.2.0}/.gitignore +0 -0
  8. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/client.py +0 -0
  9. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/errors.py +0 -0
  10. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/pagination.py +0 -0
  11. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/py.typed +0 -0
  12. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/__init__.py +0 -0
  13. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/auth.py +0 -0
  14. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/community.py +0 -0
  15. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/explore.py +0 -0
  16. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/interaction.py +0 -0
  17. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/list_.py +0 -0
  18. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/post.py +0 -0
  19. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/space.py +0 -0
  20. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/tweet.py +0 -0
  21. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/unencrypted_dm.py +0 -0
  22. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/user.py +0 -0
  23. {tweetapi-2.0.0 → tweetapi-2.2.0}/tweetapi/resources/xchat.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: tweetapi
3
- Version: 2.0.0
3
+ Version: 2.2.0
4
4
  Summary: Official Python SDK for TweetAPI — Twitter/X Data API for developers and researchers
5
5
  Project-URL: Homepage, https://tweetapi.com?utm_source=pypi&utm_medium=readme&utm_campaign=python-sdk
6
6
  Project-URL: Documentation, https://tweetapi.com/docs?utm_source=pypi&utm_medium=readme&utm_campaign=python-sdk
@@ -127,6 +127,8 @@ next_page = client.user.get_followers(
127
127
  | `client.profile.update(auth_token=..., name=..., bio=..., location=..., website=..., proxy=...)` | Update profile fields |
128
128
  | `client.profile.avatar(auth_token=..., media=..., proxy=...)` | Update profile avatar |
129
129
  | `client.profile.banner(auth_token=..., media=..., proxy=...)` | Update profile banner |
130
+ | `client.profile.remove_banner(auth_token=..., proxy=...)` | Remove the profile banner |
131
+ | `client.profile.set_privacy(auth_token=..., is_private=..., proxy=...)` | Make the account public or private |
130
132
 
131
133
  ### Interaction
132
134
 
@@ -254,6 +256,8 @@ client.profile.banner(
254
256
  auth_token="AUTH_TOKEN",
255
257
  media={"data": "BASE64_IMAGE_DATA", "type": "image/png"},
256
258
  )
259
+ client.profile.remove_banner(auth_token="AUTH_TOKEN")
260
+ client.profile.set_privacy(auth_token="AUTH_TOKEN", is_private=True)
257
261
  ```
258
262
 
259
263
  Canonical list mutations live under `client.list`; the legacy interaction list helpers remain available:
@@ -97,6 +97,8 @@ next_page = client.user.get_followers(
97
97
  | `client.profile.update(auth_token=..., name=..., bio=..., location=..., website=..., proxy=...)` | Update profile fields |
98
98
  | `client.profile.avatar(auth_token=..., media=..., proxy=...)` | Update profile avatar |
99
99
  | `client.profile.banner(auth_token=..., media=..., proxy=...)` | Update profile banner |
100
+ | `client.profile.remove_banner(auth_token=..., proxy=...)` | Remove the profile banner |
101
+ | `client.profile.set_privacy(auth_token=..., is_private=..., proxy=...)` | Make the account public or private |
100
102
 
101
103
  ### Interaction
102
104
 
@@ -224,6 +226,8 @@ client.profile.banner(
224
226
  auth_token="AUTH_TOKEN",
225
227
  media={"data": "BASE64_IMAGE_DATA", "type": "image/png"},
226
228
  )
229
+ client.profile.remove_banner(auth_token="AUTH_TOKEN")
230
+ client.profile.set_privacy(auth_token="AUTH_TOKEN", is_private=True)
227
231
  ```
228
232
 
229
233
  Canonical list mutations live under `client.list`; the legacy interaction list helpers remain available:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "tweetapi"
7
- version = "2.0.0"
7
+ version = "2.2.0"
8
8
  description = "Official Python SDK for TweetAPI — Twitter/X Data API for developers and researchers"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -37,4 +37,4 @@ __all__ = [
37
37
  "paginate_pages",
38
38
  ]
39
39
 
40
- __version__ = "2.0.0"
40
+ __version__ = "2.2.0"
@@ -4,7 +4,7 @@ from typing import Optional, TYPE_CHECKING
4
4
 
5
5
  if TYPE_CHECKING:
6
6
  from ..client import TweetAPI
7
- from ..types import ProfileMediaInput, UserResponse
7
+ from ..types import ProfileMediaInput, ProfilePrivacyResponse, UserResponse
8
8
 
9
9
 
10
10
  class ProfileResource:
@@ -29,3 +29,15 @@ class ProfileResource:
29
29
  return self._client._post("/tw-v2/profile/banner", {
30
30
  "authToken": auth_token, "media": media, "proxy": proxy,
31
31
  })
32
+
33
+ def remove_banner(self, *, auth_token: str, proxy: Optional[str] = None) -> UserResponse:
34
+ """Remove the authenticated user's banner."""
35
+ return self._client._post("/tw-v2/profile/remove-banner", {
36
+ "authToken": auth_token, "proxy": proxy,
37
+ })
38
+
39
+ def set_privacy(self, *, auth_token: str, is_private: bool, proxy: Optional[str] = None) -> ProfilePrivacyResponse:
40
+ """Change the authenticated account between public and private."""
41
+ return self._client._post("/tw-v2/profile/privacy", {
42
+ "authToken": auth_token, "isPrivate": is_private, "proxy": proxy,
43
+ })
@@ -284,6 +284,14 @@ class Place(TypedDict, total=False):
284
284
  # ─── Tweet ───────────────────────────────────────────────────────────────────
285
285
 
286
286
 
287
+ class Article(TypedDict):
288
+ id: str
289
+ title: str
290
+ text: str
291
+ previewText: str
292
+ coverImageUrl: Optional[str]
293
+
294
+
287
295
  class ReplyTo(TypedDict):
288
296
  tweetId: str
289
297
  userId: str
@@ -357,6 +365,7 @@ class Tweet(TypedDict, total=False):
357
365
  media: Optional[list[Media]]
358
366
  poll: Optional[Poll]
359
367
  card: Optional[Card]
368
+ article: Optional[Article]
360
369
  hashtags: list[str]
361
370
  mentions: list[Mention]
362
371
  urls: list[str]
@@ -551,6 +560,14 @@ class UserResponse(TypedDict):
551
560
  data: User
552
561
 
553
562
 
563
+ class ProfilePrivacy(TypedDict):
564
+ isPrivate: bool
565
+
566
+
567
+ class ProfilePrivacyResponse(TypedDict):
568
+ data: ProfilePrivacy
569
+
570
+
554
571
  class UsersResponse(TypedDict):
555
572
  data: list[User]
556
573
 
File without changes
File without changes
File without changes
File without changes