swarmauri_tool_gmail 0.9.0.dev4__tar.gz → 0.9.2.dev6__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.
@@ -0,0 +1,115 @@
1
+ Metadata-Version: 2.4
2
+ Name: swarmauri_tool_gmail
3
+ Version: 0.9.2.dev6
4
+ Summary: example community package
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Keywords: swarmauri,tool,gmail,example,community,package
8
+ Author: Jacob Stewart
9
+ Author-email: jacob@swarmauri.com
10
+ Requires-Python: >=3.10,<3.13
11
+ Classifier: License :: OSI Approved :: Apache Software License
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Natural Language :: English
16
+ Classifier: Development Status :: 3 - Alpha
17
+ Classifier: Intended Audience :: Developers
18
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
19
+ Requires-Dist: google-api-python-client (>=2.157.0)
20
+ Requires-Dist: swarmauri_base
21
+ Requires-Dist: swarmauri_core
22
+ Requires-Dist: swarmauri_standard
23
+ Description-Content-Type: text/markdown
24
+
25
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
26
+
27
+ <p align="center">
28
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
29
+ <img src="https://img.shields.io/pypi/dm/swarmauri_tool_gmail" alt="PyPI - Downloads"/></a>
30
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail/">
31
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail.svg"/></a>
32
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
33
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_gmail" alt="PyPI - Python Version"/></a>
34
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
35
+ <img src="https://img.shields.io/pypi/l/swarmauri_tool_gmail" alt="PyPI - License"/></a>
36
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
37
+ <img src="https://img.shields.io/pypi/v/swarmauri_tool_gmail?label=swarmauri_tool_gmail&color=green" alt="PyPI - swarmauri_tool_gmail"/></a>
38
+ </p>
39
+
40
+ ---
41
+
42
+ # Swarmauri Tool Gmail
43
+
44
+ Tools for sending and reading Gmail messages via Google Workspace service-account delegation. Provides `GmailSendTool` and `GmailReadTool` wrappers around the Gmail REST API.
45
+
46
+ ## Features
47
+
48
+ - `GmailSendTool` sends HTML emails to one or more recipients.
49
+ - `GmailReadTool` fetches messages matching a Gmail search query and formats key headers.
50
+ - Both tools authenticate with `googleapiclient` using a service account JSON file and delegated user email.
51
+
52
+ ## Prerequisites
53
+
54
+ - Python 3.10 or newer.
55
+ - Google Cloud service account with Gmail API enabled and domain-wide delegation to the target user.
56
+ - Credentials JSON file with the `https://www.googleapis.com/auth/gmail.send` and/or `https://www.googleapis.com/auth/gmail.readonly` scopes.
57
+ - Install `google-api-python-client` and `google-auth` (pulled in automatically).
58
+
59
+ ## Installation
60
+
61
+ ```bash
62
+ # pip
63
+ pip install swarmauri_tool_gmail
64
+
65
+ # poetry
66
+ poetry add swarmauri_tool_gmail
67
+
68
+ # uv (pyproject-based projects)
69
+ uv add swarmauri_tool_gmail
70
+ ```
71
+
72
+ ## Sending Email
73
+
74
+ ```python
75
+ from swarmauri_tool_gmail import GmailSendTool
76
+
77
+ send_tool = GmailSendTool(
78
+ credentials_path="service-account.json",
79
+ sender_email="user@yourdomain.com",
80
+ )
81
+
82
+ result = send_tool(
83
+ recipients="recipient@example.com",
84
+ subject="Test Email",
85
+ htmlMsg="<p>Hello, this is a test email!</p>",
86
+ )
87
+
88
+ print(result)
89
+ ```
90
+
91
+ ## Reading Email
92
+
93
+ ```python
94
+ from swarmauri_tool_gmail import GmailReadTool
95
+
96
+ read_tool = GmailReadTool(
97
+ credentials_path="service-account.json",
98
+ sender_email="user@yourdomain.com",
99
+ )
100
+
101
+ result = read_tool(query="is:unread", max_results=5)
102
+ print(result["gmail_messages"])
103
+ ```
104
+
105
+ ## Tips
106
+
107
+ - Ensure the service account has been granted domain-wide delegation and that the Gmail API is enabled in Google Cloud console.
108
+ - Store credentials securely (Secrets Manager, Vault) and inject the file path via environment variables.
109
+ - When sending to multiple recipients, supply a comma-separated string (Gmail handles the formatting).
110
+ - For message bodies beyond simple HTML, extend the tool to add attachments or alternative MIME parts.
111
+
112
+ ## Want to help?
113
+
114
+ If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
115
+
@@ -0,0 +1,90 @@
1
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/3d4d1cfa949399d7019ae9d8f296afba773dfb7f/assets/swarmauri.brand.theme.svg)
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
5
+ <img src="https://img.shields.io/pypi/dm/swarmauri_tool_gmail" alt="PyPI - Downloads"/></a>
6
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail/">
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail.svg"/></a>
8
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
9
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_gmail" alt="PyPI - Python Version"/></a>
10
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
11
+ <img src="https://img.shields.io/pypi/l/swarmauri_tool_gmail" alt="PyPI - License"/></a>
12
+ <a href="https://pypi.org/project/swarmauri_tool_gmail/">
13
+ <img src="https://img.shields.io/pypi/v/swarmauri_tool_gmail?label=swarmauri_tool_gmail&color=green" alt="PyPI - swarmauri_tool_gmail"/></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ # Swarmauri Tool Gmail
19
+
20
+ Tools for sending and reading Gmail messages via Google Workspace service-account delegation. Provides `GmailSendTool` and `GmailReadTool` wrappers around the Gmail REST API.
21
+
22
+ ## Features
23
+
24
+ - `GmailSendTool` sends HTML emails to one or more recipients.
25
+ - `GmailReadTool` fetches messages matching a Gmail search query and formats key headers.
26
+ - Both tools authenticate with `googleapiclient` using a service account JSON file and delegated user email.
27
+
28
+ ## Prerequisites
29
+
30
+ - Python 3.10 or newer.
31
+ - Google Cloud service account with Gmail API enabled and domain-wide delegation to the target user.
32
+ - Credentials JSON file with the `https://www.googleapis.com/auth/gmail.send` and/or `https://www.googleapis.com/auth/gmail.readonly` scopes.
33
+ - Install `google-api-python-client` and `google-auth` (pulled in automatically).
34
+
35
+ ## Installation
36
+
37
+ ```bash
38
+ # pip
39
+ pip install swarmauri_tool_gmail
40
+
41
+ # poetry
42
+ poetry add swarmauri_tool_gmail
43
+
44
+ # uv (pyproject-based projects)
45
+ uv add swarmauri_tool_gmail
46
+ ```
47
+
48
+ ## Sending Email
49
+
50
+ ```python
51
+ from swarmauri_tool_gmail import GmailSendTool
52
+
53
+ send_tool = GmailSendTool(
54
+ credentials_path="service-account.json",
55
+ sender_email="user@yourdomain.com",
56
+ )
57
+
58
+ result = send_tool(
59
+ recipients="recipient@example.com",
60
+ subject="Test Email",
61
+ htmlMsg="<p>Hello, this is a test email!</p>",
62
+ )
63
+
64
+ print(result)
65
+ ```
66
+
67
+ ## Reading Email
68
+
69
+ ```python
70
+ from swarmauri_tool_gmail import GmailReadTool
71
+
72
+ read_tool = GmailReadTool(
73
+ credentials_path="service-account.json",
74
+ sender_email="user@yourdomain.com",
75
+ )
76
+
77
+ result = read_tool(query="is:unread", max_results=5)
78
+ print(result["gmail_messages"])
79
+ ```
80
+
81
+ ## Tips
82
+
83
+ - Ensure the service account has been granted domain-wide delegation and that the Gmail API is enabled in Google Cloud console.
84
+ - Store credentials securely (Secrets Manager, Vault) and inject the file path via environment variables.
85
+ - When sending to multiple recipients, supply a comma-separated string (Gmail handles the formatting).
86
+ - For message bodies beyond simple HTML, extend the tool to add attachments or alternative MIME parts.
87
+
88
+ ## Want to help?
89
+
90
+ If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "swarmauri_tool_gmail"
3
- version = "0.9.0.dev4"
3
+ version = "0.9.2.dev6"
4
4
  description = "example community package"
5
5
  license = "Apache-2.0"
6
6
  readme = "README.md"
@@ -11,6 +11,10 @@ classifiers = [
11
11
  "Programming Language :: Python :: 3.10",
12
12
  "Programming Language :: Python :: 3.11",
13
13
  "Programming Language :: Python :: 3.12",
14
+ "Natural Language :: English",
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "Topic :: Software Development :: Libraries :: Application Frameworks",
14
18
  ]
15
19
  authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
16
20
  dependencies = [
@@ -19,6 +23,14 @@ dependencies = [
19
23
  "swarmauri_base",
20
24
  "swarmauri_standard",
21
25
  ]
26
+ keywords = [
27
+ "swarmauri",
28
+ "tool",
29
+ "gmail",
30
+ "example",
31
+ "community",
32
+ "package",
33
+ ]
22
34
 
23
35
  [tool.uv.sources]
24
36
  swarmauri_core = { workspace = true }
@@ -1,86 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: swarmauri_tool_gmail
3
- Version: 0.9.0.dev4
4
- Summary: example community package
5
- License: Apache-2.0
6
- Author: Jacob Stewart
7
- Author-email: jacob@swarmauri.com
8
- Requires-Python: >=3.10,<3.13
9
- Classifier: License :: OSI Approved :: Apache Software License
10
- Classifier: Programming Language :: Python :: 3.10
11
- Classifier: Programming Language :: Python :: 3.11
12
- Classifier: Programming Language :: Python :: 3.12
13
- Requires-Dist: google-api-python-client (>=2.157.0)
14
- Requires-Dist: swarmauri_base
15
- Requires-Dist: swarmauri_core
16
- Requires-Dist: swarmauri_standard
17
- Description-Content-Type: text/markdown
18
-
19
-
20
- ![Swamauri Logo](https://res.cloudinary.com/dbjmpekvl/image/upload/v1730099724/Swarmauri-logo-lockup-2048x757_hww01w.png)
21
-
22
- <p align="center">
23
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
24
- <img src="https://img.shields.io/pypi/dm/swarmauri_tool_gmail" alt="PyPI - Downloads"/></a>
25
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail/">
26
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail.svg"/></a>
27
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
28
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_gmail" alt="PyPI - Python Version"/></a>
29
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
30
- <img src="https://img.shields.io/pypi/l/swarmauri_tool_gmail" alt="PyPI - License"/></a>
31
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
32
- <img src="https://img.shields.io/pypi/v/swarmauri_tool_gmail?label=swarmauri_tool_gmail&color=green" alt="PyPI - swarmauri_tool_gmail"/></a>
33
- </p>
34
-
35
- ---
36
-
37
- # Swarmauri Tool Gmail
38
-
39
- A Swarmauri tool package for interacting with Gmail API, providing functionality to send and read emails.
40
-
41
- ## Installation
42
-
43
- ```bash
44
- pip install swarmauri_tool_gmail
45
- ```
46
-
47
- ## Usage
48
-
49
- ### Sending Emails
50
- ```python
51
- from swarmauri.tools.GmailSendTool import GmailSendTool
52
-
53
- # Initialize the tool
54
- send_tool = GmailSendTool(
55
- credentials_path="path/to/credentials.json",
56
- sender_email="your-email@example.com",
57
- service={"serviceName": "gmail", "version": "v1"}
58
- )
59
-
60
- # Send an email
61
- result = send_tool(
62
- recipients="recipient@example.com",
63
- subject="Test Email",
64
- htmlMsg="<p>Hello, this is a test email!</p>"
65
- )
66
- ```
67
-
68
- ### Reading Emails
69
- ```python
70
- from swarmauri.tools.GmailReadTool import GmailReadTool
71
-
72
- # Initialize the tool
73
- read_tool = GmailReadTool(
74
- credentials_path="path/to/credentials.json",
75
- sender_email="your-email@example.com"
76
- )
77
-
78
- # Read unread emails
79
- result = read_tool(query="is:unread", max_results=10)
80
- ```
81
-
82
- ## Want to help?
83
-
84
- If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
85
-
86
-
@@ -1,67 +0,0 @@
1
-
2
- ![Swamauri Logo](https://res.cloudinary.com/dbjmpekvl/image/upload/v1730099724/Swarmauri-logo-lockup-2048x757_hww01w.png)
3
-
4
- <p align="center">
5
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
6
- <img src="https://img.shields.io/pypi/dm/swarmauri_tool_gmail" alt="PyPI - Downloads"/></a>
7
- <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail/">
8
- <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_tool_gmail.svg"/></a>
9
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
10
- <img src="https://img.shields.io/pypi/pyversions/swarmauri_tool_gmail" alt="PyPI - Python Version"/></a>
11
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
12
- <img src="https://img.shields.io/pypi/l/swarmauri_tool_gmail" alt="PyPI - License"/></a>
13
- <a href="https://pypi.org/project/swarmauri_tool_gmail/">
14
- <img src="https://img.shields.io/pypi/v/swarmauri_tool_gmail?label=swarmauri_tool_gmail&color=green" alt="PyPI - swarmauri_tool_gmail"/></a>
15
- </p>
16
-
17
- ---
18
-
19
- # Swarmauri Tool Gmail
20
-
21
- A Swarmauri tool package for interacting with Gmail API, providing functionality to send and read emails.
22
-
23
- ## Installation
24
-
25
- ```bash
26
- pip install swarmauri_tool_gmail
27
- ```
28
-
29
- ## Usage
30
-
31
- ### Sending Emails
32
- ```python
33
- from swarmauri.tools.GmailSendTool import GmailSendTool
34
-
35
- # Initialize the tool
36
- send_tool = GmailSendTool(
37
- credentials_path="path/to/credentials.json",
38
- sender_email="your-email@example.com",
39
- service={"serviceName": "gmail", "version": "v1"}
40
- )
41
-
42
- # Send an email
43
- result = send_tool(
44
- recipients="recipient@example.com",
45
- subject="Test Email",
46
- htmlMsg="<p>Hello, this is a test email!</p>"
47
- )
48
- ```
49
-
50
- ### Reading Emails
51
- ```python
52
- from swarmauri.tools.GmailReadTool import GmailReadTool
53
-
54
- # Initialize the tool
55
- read_tool = GmailReadTool(
56
- credentials_path="path/to/credentials.json",
57
- sender_email="your-email@example.com"
58
- )
59
-
60
- # Read unread emails
61
- result = read_tool(query="is:unread", max_results=10)
62
- ```
63
-
64
- ## Want to help?
65
-
66
- If you want to contribute to swarmauri-sdk, read up on our [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/contributing.md) that will help you get started.
67
-