marqetive-lib 0.2.4__tar.gz → 0.2.6__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 (38) hide show
  1. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/PKG-INFO +1 -1
  2. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/pyproject.toml +1 -1
  3. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/core/models.py +2 -0
  4. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/linkedin/client.py +17 -15
  5. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/tiktok/client.py +3 -1
  6. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/twitter/client.py +17 -3
  7. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/retry.py +1 -1
  8. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/README.md +0 -0
  9. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/__init__.py +0 -0
  10. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/core/__init__.py +0 -0
  11. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/core/base.py +0 -0
  12. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/core/client.py +0 -0
  13. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/core/exceptions.py +0 -0
  14. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/factory.py +0 -0
  15. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/__init__.py +0 -0
  16. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/instagram/__init__.py +0 -0
  17. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/instagram/client.py +0 -0
  18. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/instagram/exceptions.py +0 -0
  19. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/instagram/media.py +0 -0
  20. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/instagram/models.py +0 -0
  21. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/linkedin/__init__.py +0 -0
  22. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/linkedin/exceptions.py +0 -0
  23. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/linkedin/media.py +0 -0
  24. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/linkedin/models.py +0 -0
  25. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/tiktok/__init__.py +0 -0
  26. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/tiktok/exceptions.py +0 -0
  27. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/tiktok/media.py +0 -0
  28. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/tiktok/models.py +0 -0
  29. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/twitter/__init__.py +0 -0
  30. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/twitter/exceptions.py +0 -0
  31. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/twitter/media.py +0 -0
  32. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/platforms/twitter/models.py +0 -0
  33. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/py.typed +0 -0
  34. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/__init__.py +0 -0
  35. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/file_handlers.py +0 -0
  36. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/helpers.py +0 -0
  37. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/media.py +0 -0
  38. {marqetive_lib-0.2.4 → marqetive_lib-0.2.6}/src/marqetive/utils/oauth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: marqetive-lib
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: Modern Python utilities for web APIs
5
5
  Keywords: api,utilities,web,http,marqetive
6
6
  Requires-Python: >=3.12
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [project]
6
6
  name = "marqetive-lib"
7
- version = "0.2.4"
7
+ version = "0.2.6"
8
8
  description = "Modern Python utilities for web APIs"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"
@@ -423,6 +423,8 @@ 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
426
428
  additional_data: dict[str, Any] = Field(default_factory=dict)
427
429
 
428
430
 
@@ -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
  )
@@ -621,6 +621,9 @@ class TwitterClient(SocialMediaPlatform):
621
621
  url=HttpUrl(media_url),
622
622
  )
623
623
 
624
+ except PlatformAuthError:
625
+ # Re-raise auth errors (including TwitterUnauthorizedError) directly
626
+ raise
624
627
  except Exception as e:
625
628
  raise MediaUploadError(
626
629
  f"Failed to upload media: {e}",
@@ -784,6 +787,11 @@ class TwitterClient(SocialMediaPlatform):
784
787
  post_request = post_request.model_copy(
785
788
  update={"reply_to_post_id": reply_to_id}
786
789
  )
790
+ if post_request.is_quoted and created_posts:
791
+ post_request = post_request.model_copy(
792
+ update={"quote_post_id": created_posts[0].post_id}
793
+ )
794
+
787
795
  # TwitterPostRequest works with create_post via duck typing
788
796
  final_request = post_request
789
797
  else:
@@ -795,6 +803,10 @@ class TwitterClient(SocialMediaPlatform):
795
803
  }
796
804
  if reply_to_id is not None:
797
805
  request_data["reply_to_post_id"] = reply_to_id
806
+
807
+ if post_request.is_quoted and created_posts:
808
+ request_data["quote_post_id"] = created_posts[0].post_id
809
+
798
810
  final_request = TwitterPostRequest(**request_data)
799
811
 
800
812
  # TwitterPostRequest has compatible interface with PostCreateRequest
@@ -914,9 +926,11 @@ class TwitterClient(SocialMediaPlatform):
914
926
  return MediaAttachment(
915
927
  media_id=result.media_id,
916
928
  media_type=MediaType.IMAGE, # Simplified type
917
- url=HttpUrl(media_url)
918
- if media_url.startswith("http")
919
- else HttpUrl(f"file://{media_url}"),
929
+ url=(
930
+ HttpUrl(media_url)
931
+ if media_url.startswith("http")
932
+ else HttpUrl(f"file://{media_url}")
933
+ ),
920
934
  )
921
935
 
922
936
  except Exception as e:
@@ -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
 
File without changes