JT_Gmail
This is a simple interface for programmatically sending emails using the Gmail API.
pip install JT_Gmail
To get started you must create a project and enable the Gmail API, create OAuth2 credentials and download them in a json file.
Before you can use this module for the first time, you must run:
import JT_Gmail as gmail
gmail.GetToken(scopes=['scope1', 'scope2'], email_address='user@gmail.com', cred_path="path_to_your_credentials.json")
Supply the scopes you plan on using as *args. A list of all the scopes can be found here. Each function also includes the required scopes in its docstring.
This will prompt for authentication and generate the proper token to use the scopes you supplied. The token and credentials are saved for later use, so you might only have to run that line once. As you perform actions, if they need new permissions, they will be requested. Authentication will be required for each gmail user you wish to use.
To send emails, it's as easy as:
import JT_Gmail as gmail
with open("email.html") as file:
gmail.SendHTMLEmail(
sender='sender@gmail.com',
to="recipient@some.website",
subject="Example Email",
message_html=file.read()
)
This was base heavily on code snippets supplied by Google.
Metadata
Release files for JT-Gmail 0.0.24
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| JT_Gmail-0.0.24.tar.gz | 7.5 kB | Without provenance | Details for JT_Gmail-0.0.24.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| JT_Gmail-0.0.24-py3-none-any.whl | Python 3 | none | any | Details for JT_Gmail-0.0.24-py3-none-any.whl |
Total release size: 16.8 kB
Release files / JT_Gmail-0.0.24.tar.gz
| Download URL | JT_Gmail-0.0.24.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9857d8fe71cb6d616c2d88c4774b0384465e59cf6c8289924c1ecb35cdce3ed6
|
|
BLAKE2b-256 checksum How to use checksums |
a6972cdbdfa5ca2990413f6d9e7cd956485aa7769b73bedfe545b4b3d45671a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4
|
Release files / JT_Gmail-0.0.24-py3-none-any.whl
| Download URL | JT_Gmail-0.0.24-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e8151966f807670fc3b162391cfa9d4e37e3e9d2c8868c63f6e551882a4a9150
|
|
BLAKE2b-256 checksum How to use checksums |
86570961d2c0e6bb22fd4e98089f6ba1c680b183655fcc4576fc444f9213ef27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4
|
Security for JT-Gmail 0.0.24
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.