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.
- {gws_cli-1.3.0 → gws_cli-1.3.1}/PKG-INFO +1 -1
- {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL-advanced.md +3 -3
- {gws_cli-1.3.0 → gws_cli-1.3.1}/pyproject.toml +1 -1
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/gmail.md +2 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/gmail.py +33 -24
- {gws_cli-1.3.0 → gws_cli-1.3.1}/.gitignore +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/CLAUDE.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/COMPARISON-REPORT.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/LICENSE +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/LIVE_TESTING.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/README.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL-typesetting.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/SKILL.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/TESTING.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-download-security-gate.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-security-hardening-design.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/docs/plans/2026-03-07-security-hardening-plan.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/calendar.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/contacts.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/docs.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/drive.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/sheets.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/reference/slides.md +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/__main__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/oauth.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/provider.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/scopes.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/auth/server.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/cli.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/_account.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/calendar.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/contacts.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/convert.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/docs.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/drive.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/gmail.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/sheets.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/commands/slides.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/config.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/context.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/crypto.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/exceptions.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/output.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/base.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/calendar.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/contacts.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/convert.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/docs.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/drive.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/sheets.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/services/slides.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/colors.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/diagrams.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/retry.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/src/gws/utils/security.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/__init__.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/conftest.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_account_commands.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_account_enforcement.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_auth_accounts.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_auth_provider.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_config_accounts.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_crypto.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_docs.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_download_screening.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_gmail_mime.py +0 -0
- {gws_cli-1.3.0 → gws_cli-1.3.1}/tests/test_output.py +0 -0
- {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.
|
|
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
|
-
#
|
|
400
|
-
#
|
|
401
|
-
uvx gws-cli gmail list --max
|
|
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.
|
|
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
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
batch.
|
|
63
|
-
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
673
|
-
|
|
674
|
-
batch.
|
|
675
|
-
|
|
676
|
-
.
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|