marqetive-lib 0.2.5__py3-none-any.whl → 0.2.7__py3-none-any.whl

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.
marqetive/core/models.py CHANGED
@@ -423,6 +423,9 @@ class PostCreateRequest(BaseModel):
423
423
  link: str | None = None
424
424
  tags: list[str] = Field(default_factory=list)
425
425
  location: str | None = None
426
+ is_quoted: bool | None = None
427
+ quoted_card_id: str | None = None # for future we can quote other than first tweet
428
+ quoted_tweet_id: str | None = None
426
429
  additional_data: dict[str, Any] = Field(default_factory=dict)
427
430
 
428
431
 
@@ -48,21 +48,23 @@ from marqetive.platforms.linkedin.models import (
48
48
 
49
49
  # Valid CTA (Call-To-Action) labels per LinkedIn API documentation
50
50
  # Note: BUY_NOW and SHOP_NOW require API version 202504 or later
51
- VALID_CTA_LABELS = frozenset({
52
- "APPLY",
53
- "DOWNLOAD",
54
- "VIEW_QUOTE",
55
- "LEARN_MORE",
56
- "SIGN_UP",
57
- "SUBSCRIBE",
58
- "REGISTER",
59
- "JOIN",
60
- "ATTEND",
61
- "REQUEST_DEMO",
62
- "SEE_MORE",
63
- "BUY_NOW", # Requires API version 202504+
64
- "SHOP_NOW", # Requires API version 202504+
65
- })
51
+ VALID_CTA_LABELS = frozenset(
52
+ {
53
+ "APPLY",
54
+ "DOWNLOAD",
55
+ "VIEW_QUOTE",
56
+ "LEARN_MORE",
57
+ "SIGN_UP",
58
+ "SUBSCRIBE",
59
+ "REGISTER",
60
+ "JOIN",
61
+ "ATTEND",
62
+ "REQUEST_DEMO",
63
+ "SEE_MORE",
64
+ "BUY_NOW", # Requires API version 202504+
65
+ "SHOP_NOW", # Requires API version 202504+
66
+ }
67
+ )
66
68
 
67
69
 
68
70
  class LinkedInClient(SocialMediaPlatform):
@@ -257,7 +257,9 @@ class TikTokClient(SocialMediaPlatform):
257
257
  # 4. Return minimal Post object without fetching details
258
258
  video_id = upload_result.video_id or upload_result.publish_id
259
259
  url = (
260
- HttpUrl(f"https://www.tiktok.com/@{self.credentials.username}/video/{video_id}")
260
+ HttpUrl(
261
+ f"https://www.tiktok.com/@{self.credentials.username}/video/{video_id}"
262
+ )
261
263
  if self.credentials.username and video_id
262
264
  else None
263
265
  )
@@ -787,6 +787,16 @@ class TwitterClient(SocialMediaPlatform):
787
787
  post_request = post_request.model_copy(
788
788
  update={"reply_to_post_id": reply_to_id}
789
789
  )
790
+ if post_request.quoted_tweet_id:
791
+ post_request = post_request.model_copy(
792
+ update={"quote_post_id": post_request.quoted_tweet_id}
793
+ )
794
+
795
+ elif post_request.is_quoted and created_posts:
796
+ post_request = post_request.model_copy(
797
+ update={"quote_post_id": created_posts[0].post_id}
798
+ )
799
+
790
800
  # TwitterPostRequest works with create_post via duck typing
791
801
  final_request = post_request
792
802
  else:
@@ -798,6 +808,13 @@ class TwitterClient(SocialMediaPlatform):
798
808
  }
799
809
  if reply_to_id is not None:
800
810
  request_data["reply_to_post_id"] = reply_to_id
811
+
812
+ if post_request.quoted_tweet_id:
813
+ request_data["quote_post_id"] = post_request.quoted_tweet_id
814
+
815
+ elif post_request.is_quoted and created_posts:
816
+ request_data["quote_post_id"] = created_posts[0].post_id
817
+
801
818
  final_request = TwitterPostRequest(**request_data)
802
819
 
803
820
  # TwitterPostRequest has compatible interface with PostCreateRequest
marqetive/utils/retry.py CHANGED
@@ -93,7 +93,7 @@ def is_retryable_error(error: Exception) -> bool:
93
93
 
94
94
  # Network/connection errors are retryable
95
95
  if isinstance(
96
- error, (httpx.ConnectError, httpx.TimeoutException, httpx.NetworkError)
96
+ error, httpx.ConnectError | httpx.TimeoutException | httpx.NetworkError
97
97
  ):
98
98
  return True
99
99
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: marqetive-lib
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Modern Python utilities for web APIs
5
5
  Keywords: api,utilities,web,http,marqetive
6
6
  Requires-Python: >=3.12
@@ -3,7 +3,7 @@ marqetive/core/__init__.py,sha256=0_0vzxJ619YIJkz1yzSvhnGDJRkrErs_QSg2q3Bloss,11
3
3
  marqetive/core/base.py,sha256=I2pRHJWIizSgUtGum1pW1TrJwCRgLE5vljLmJI7Z2Og,20323
4
4
  marqetive/core/client.py,sha256=eCtvL100dkxYQHC_TJzHbs3dGjgsa_me9VTHo-CUN2M,3900
5
5
  marqetive/core/exceptions.py,sha256=h4boyxGY2tUQXMfnDcpVzAKVW71VpqvOZtGkQ-oVkYM,9710
6
- marqetive/core/models.py,sha256=0n5z1GcrNJWmPCgc_k5glxd3dLGUANwp4qvHCM5FIC4,19287
6
+ marqetive/core/models.py,sha256=2Cb7sJUOgFw_rKfKiVnAvYJUHPAa5NCLkWvurRtAtnY,19448
7
7
  marqetive/factory.py,sha256=SfHsp6mdIZpDBtryUvHSwljBRkCyAHhtwV7qDfgL9k4,15268
8
8
  marqetive/platforms/__init__.py,sha256=RBxlQSGyELsulSnwf5uaE1ohxFc7jC61OO9CrKaZp48,1312
9
9
  marqetive/platforms/instagram/__init__.py,sha256=c1Gs0ozG6D7Z-Uz_UQ7S3joL0qUTT9eUZPWcePyESk8,229
@@ -12,17 +12,17 @@ marqetive/platforms/instagram/exceptions.py,sha256=TcD_pX4eSx_k4yW8DgfA6SGPiAz3V
12
12
  marqetive/platforms/instagram/media.py,sha256=0ZbUbpwJ025_hccL9X8qced_-LJGoL_-NdS84Op97VE,23228
13
13
  marqetive/platforms/instagram/models.py,sha256=20v3m1037y3b_WlsKF8zAOgV23nFu63tfmmUN1CefOI,2769
14
14
  marqetive/platforms/linkedin/__init__.py,sha256=_FrdZpqcXjcUW6C-25zGV7poGih9yzs6y1AFnuizTUQ,1384
15
- marqetive/platforms/linkedin/client.py,sha256=-0YiAPv75zwsjuOoCEb7OFFH5gIlaRLd7eHDTWmLg3U,74826
15
+ marqetive/platforms/linkedin/client.py,sha256=KOcg31aFVglAF0P48MagSLfZHAQxzsdhDFWOJedI-iY,74888
16
16
  marqetive/platforms/linkedin/exceptions.py,sha256=i5fARUkZik46bS3htZBwUInVzetsZx1APpKEXLrCKf0,9762
17
17
  marqetive/platforms/linkedin/media.py,sha256=-kpkL5brYhx8cZlFS5ueDgY4eSZWqHoB6xp8jZU2cyI,25931
18
18
  marqetive/platforms/linkedin/models.py,sha256=n7DqwVxYSbGYBmeEJ1woCZ6XhUIHcLx8Gpm8uCBACzI,12620
19
19
  marqetive/platforms/tiktok/__init__.py,sha256=BqjkXTZDyBlcY3lvREy13yP9h3RcDga8E6Rl6f5KPp8,238
20
- marqetive/platforms/tiktok/client.py,sha256=IhLCphzu_qxTSP6CDFqLBQqM3zJ7bLy7uHDSErc-qA8,18968
20
+ marqetive/platforms/tiktok/client.py,sha256=vp2kJnlsywL339N_p-aXtKdmNrragKlKfbyzij6UB7Y,18998
21
21
  marqetive/platforms/tiktok/exceptions.py,sha256=vxwyAKujMGZJh0LetG1QsLF95QfUs_kR6ujsWSHGqL0,10124
22
22
  marqetive/platforms/tiktok/media.py,sha256=NmvzvzfaZMmzIx88wkXI5tWLd4vYN1VJXN-IkaEAO2c,28638
23
23
  marqetive/platforms/tiktok/models.py,sha256=WWdjuFqhTIR8SnHkz-8UaNc5Mm2PrGomwQ3W7pJcQFg,2962
24
24
  marqetive/platforms/twitter/__init__.py,sha256=etiNzWd0EznrDbFTlc71dc_Cm-aqAM7RIwpj8qrYEiE,447
25
- marqetive/platforms/twitter/client.py,sha256=FehFLOh6n1YZyFe_4jrztSlw9iZK21eJzb9fHj0Jxu8,44551
25
+ marqetive/platforms/twitter/client.py,sha256=bWtKA8_ZFMkhuh8rXdABmjcxAcem3dutvBsvTqwq-cE,45256
26
26
  marqetive/platforms/twitter/exceptions.py,sha256=AvXzucqF2P6F3-lynayt461oj9e1luCh2-El5pXqZL4,9832
27
27
  marqetive/platforms/twitter/media.py,sha256=cWELUTDFlyS7WIjEzkCaXOMOiSZZ3eAwpmiX90-CDjM,28954
28
28
  marqetive/platforms/twitter/models.py,sha256=afFK1jJyrIC6BvY6ShkHlg-KnvawdeLGS-hB-GoloWA,4579
@@ -32,7 +32,7 @@ marqetive/utils/file_handlers.py,sha256=mDBGLQpCBYD-AN3W_qysZn0JmXxQE017_lnURdkk
32
32
  marqetive/utils/helpers.py,sha256=Sh5HZD6AOJig_6T84n6JsKLosIkKIkpkiYTl69rnOOw,1321
33
33
  marqetive/utils/media.py,sha256=reVousdueG-h5jeI6uLGqVCfjYxlsMiWhx6XZwg-iHY,14664
34
34
  marqetive/utils/oauth.py,sha256=3TtbUCVuGxtOBxIUvVJH_DUMIHrP76XDpabPYaLXhTU,15392
35
- marqetive/utils/retry.py,sha256=UcgrmVBVG5zd30_11mZnRnTaSFrbUYXBO1DrXPR0f8E,7627
36
- marqetive_lib-0.2.5.dist-info/METADATA,sha256=BRheSgC6_t0edQbE03iP0OlaCalnzV2XamoTHNdxnGo,7875
37
- marqetive_lib-0.2.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
38
- marqetive_lib-0.2.5.dist-info/RECORD,,
35
+ marqetive/utils/retry.py,sha256=f75gWSSz4B6tt-GfoKyWa8HNZhrw3XDGFddwCPFSfoA,7627
36
+ marqetive_lib-0.2.7.dist-info/METADATA,sha256=6a-VUnl69qmrUlhQJU81oU6XZHHa27kpVW1JaVXnZCA,7875
37
+ marqetive_lib-0.2.7.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
38
+ marqetive_lib-0.2.7.dist-info/RECORD,,