gws-cli 1.3.0__tar.gz → 1.3.1__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 (73) hide show
  1. {gws_cli-1.3.0 → gws_cli-1.3.1}/PKG-INFO +1 -1
  2. {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL-advanced.md +3 -3
  3. {gws_cli-1.3.0 → gws_cli-1.3.1}/pyproject.toml +1 -1
  4. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/gmail.md +2 -0
  5. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/gmail.py +33 -24
  6. {gws_cli-1.3.0 → gws_cli-1.3.1}/.gitignore +0 -0
  7. {gws_cli-1.3.0 → gws_cli-1.3.1}/CLAUDE.md +0 -0
  8. {gws_cli-1.3.0 → gws_cli-1.3.1}/COMPARISON-REPORT.md +0 -0
  9. {gws_cli-1.3.0 → gws_cli-1.3.1}/LICENSE +0 -0
  10. {gws_cli-1.3.0 → gws_cli-1.3.1}/LIVE_TESTING.md +0 -0
  11. {gws_cli-1.3.0 → gws_cli-1.3.1}/README.md +0 -0
  12. {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL-typesetting.md +0 -0
  13. {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL.md +0 -0
  14. {gws_cli-1.3.0 → gws_cli-1.3.1}/TESTING.md +0 -0
  15. {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-download-security-gate.md +0 -0
  16. {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-security-hardening-design.md +0 -0
  17. {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-security-hardening-plan.md +0 -0
  18. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/calendar.md +0 -0
  19. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/contacts.md +0 -0
  20. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/docs.md +0 -0
  21. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/drive.md +0 -0
  22. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/sheets.md +0 -0
  23. {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/slides.md +0 -0
  24. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/__init__.py +0 -0
  25. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/__main__.py +0 -0
  26. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/__init__.py +0 -0
  27. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/oauth.py +0 -0
  28. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/provider.py +0 -0
  29. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/scopes.py +0 -0
  30. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/server.py +0 -0
  31. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/cli.py +0 -0
  32. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/__init__.py +0 -0
  33. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/_account.py +0 -0
  34. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/calendar.py +0 -0
  35. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/contacts.py +0 -0
  36. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/convert.py +0 -0
  37. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/docs.py +0 -0
  38. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/drive.py +0 -0
  39. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/gmail.py +0 -0
  40. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/sheets.py +0 -0
  41. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/slides.py +0 -0
  42. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/config.py +0 -0
  43. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/context.py +0 -0
  44. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/crypto.py +0 -0
  45. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/exceptions.py +0 -0
  46. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/output.py +0 -0
  47. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/__init__.py +0 -0
  48. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/base.py +0 -0
  49. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/calendar.py +0 -0
  50. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/contacts.py +0 -0
  51. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/convert.py +0 -0
  52. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/docs.py +0 -0
  53. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/drive.py +0 -0
  54. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/sheets.py +0 -0
  55. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/slides.py +0 -0
  56. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/__init__.py +0 -0
  57. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/colors.py +0 -0
  58. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/diagrams.py +0 -0
  59. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/retry.py +0 -0
  60. {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/security.py +0 -0
  61. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/__init__.py +0 -0
  62. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/conftest.py +0 -0
  63. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_account_commands.py +0 -0
  64. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_account_enforcement.py +0 -0
  65. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_auth_accounts.py +0 -0
  66. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_auth_provider.py +0 -0
  67. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_config_accounts.py +0 -0
  68. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_crypto.py +0 -0
  69. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_docs.py +0 -0
  70. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_download_screening.py +0 -0
  71. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_gmail_mime.py +0 -0
  72. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_output.py +0 -0
  73. {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_server_auth.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gws-cli
3
- Version: 1.3.0
3
+ Version: 1.3.1
4
4
  Summary: Google Workspace CLI - Unified management for Docs, Sheets, Slides, Drive, Gmail, Calendar, and Contacts
5
5
  Project-URL: Homepage, https://github.com/andmarios/google-workspace-skill
6
6
  Project-URL: Repository, https://github.com/andmarios/google-workspace-skill
@@ -396,9 +396,9 @@ uvx gws-cli drive search "name contains 'report'"
396
396
  3. **Concurrent request limit**: Too many parallel requests
397
397
 
398
398
  ```bash
399
- # For bulk email operations, process in batches of 50
400
- # The gws CLI handles batching internally for list operations
401
- uvx gws-cli gmail list --max 100 # Internally batched
399
+ # The CLI automatically chunks batch requests into groups of 100.
400
+ # Values up to 500 work, but prefer ≤50 to avoid rate-limiting.
401
+ uvx gws-cli gmail list --max 50
402
402
  ```
403
403
 
404
404
  ### Google Calendar: Event ID Strategy
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "gws-cli"
7
- version = "1.3.0"
7
+ version = "1.3.1"
8
8
  description = "Google Workspace CLI - Unified management for Docs, Sheets, Slides, Drive, Gmail, Calendar, and Contacts"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -13,6 +13,8 @@
13
13
 
14
14
  ## Basic Operations
15
15
 
16
+ > **`--max` guideline:** Default is 10. Values up to 500 work (batched internally in groups of 100), but prefer ≤50 to avoid rate-limiting. Start small and paginate with `--query` filters rather than fetching hundreds at once.
17
+
16
18
  ```bash
17
19
  # List recent messages
18
20
  uvx gws-cli gmail list --max 10
@@ -16,6 +16,10 @@ from gws.services.base import BaseService
16
16
  from gws.output import output_success, output_error, output_external_content, screen_download
17
17
  from gws.exceptions import ExitCode
18
18
 
19
+ # Gmail batch HTTP requests are limited to 100 individual requests per batch.
20
+ # https://developers.google.com/workspace/gmail/api/guides/batch
21
+ _BATCH_LIMIT = 100
22
+
19
23
 
20
24
  class GmailService(BaseService):
21
25
  """Google Gmail operations."""
@@ -48,7 +52,8 @@ class GmailService(BaseService):
48
52
  msg_refs = result.get("messages", [])
49
53
 
50
54
  if msg_refs:
51
- # Use batch request to fetch all messages in one round-trip
55
+ # Use batch requests to fetch messages (chunked to stay within
56
+ # Gmail's 100-requests-per-batch limit)
52
57
  batch_results: dict[str, Any] = {}
53
58
 
54
59
  def handle_response(request_id: str, response: Any, exception: Any) -> None:
@@ -57,20 +62,22 @@ class GmailService(BaseService):
57
62
  else:
58
63
  batch_errors[request_id] = str(exception)
59
64
 
60
- batch = self.service.new_batch_http_request(callback=handle_response)
61
- for msg_ref in msg_refs:
62
- batch.add(
63
- self.service.users()
64
- .messages()
65
- .get(
66
- userId="me",
67
- id=msg_ref["id"],
68
- format="metadata",
69
- metadataHeaders=["From", "To", "Subject", "Date"],
70
- ),
71
- request_id=msg_ref["id"],
72
- )
73
- batch.execute()
65
+ for i in range(0, len(msg_refs), _BATCH_LIMIT):
66
+ chunk = msg_refs[i : i + _BATCH_LIMIT]
67
+ batch = self.service.new_batch_http_request(callback=handle_response)
68
+ for msg_ref in chunk:
69
+ batch.add(
70
+ self.service.users()
71
+ .messages()
72
+ .get(
73
+ userId="me",
74
+ id=msg_ref["id"],
75
+ format="metadata",
76
+ metadataHeaders=["From", "To", "Subject", "Date"],
77
+ ),
78
+ request_id=msg_ref["id"],
79
+ )
80
+ batch.execute()
74
81
 
75
82
  # Process batch results in original order
76
83
  for msg_ref in msg_refs:
@@ -669,15 +676,17 @@ class GmailService(BaseService):
669
676
  if exception is None:
670
677
  batch_results[request_id] = response
671
678
 
672
- batch = self.service.new_batch_http_request(callback=handle_draft_response)
673
- for draft_ref in draft_refs:
674
- batch.add(
675
- self.service.users()
676
- .drafts()
677
- .get(userId="me", id=draft_ref["id"], format="metadata"),
678
- request_id=draft_ref["id"],
679
- )
680
- batch.execute()
679
+ for i in range(0, len(draft_refs), _BATCH_LIMIT):
680
+ chunk = draft_refs[i : i + _BATCH_LIMIT]
681
+ batch = self.service.new_batch_http_request(callback=handle_draft_response)
682
+ for draft_ref in chunk:
683
+ batch.add(
684
+ self.service.users()
685
+ .drafts()
686
+ .get(userId="me", id=draft_ref["id"], format="metadata"),
687
+ request_id=draft_ref["id"],
688
+ )
689
+ batch.execute()
681
690
 
682
691
  for draft_ref in draft_refs:
683
692
  draft = batch_results.get(draft_ref["id"])
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes