Skip to main content

Gmail API Wrapper

Project description

JT_Gmail

This is a simple interface for programmatically sending emails using the Gmail API. I typically import it as

To get started you must enable the Gmail API and save the credential.json file somewhere.

Before you can use this module for the first time, you must run:

import JT_Gmail as gmail

gmail.GetToken('scope1', 'scope2',..., cred_path="path_to_your_credentials")

Supply the scopes you plan on using as *args. A list of all the scopes can be found here.

This will generate the proper token to use the scopes you supplied. The token and credentials are saved for later use, so you only have to run that line once.

To send emails, it's as easy as:

import JT_Gmail as gmail

with open("email.html") as file:
    gmail.SendHTMLEmail(
        to="recipient@some.website", 
        subject="Example Email", 
        message_html=file.read()
)

This was base heavily on code snippets supplied by Google.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

JT_Gmail-0.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

JT_Gmail-0.0.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file JT_Gmail-0.0.1.tar.gz.

File metadata

  • Download URL: JT_Gmail-0.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for JT_Gmail-0.0.1.tar.gz
Algorithm Hash digest
SHA256 74466208461dadd2b887fdfc070d2fba47f29df0341beb93dedf5ff1cfc5cf97
MD5 4e7c00bb71c897a4fb56c17b740f1ad2
BLAKE2b-256 b058ce019dbacfaaee2c7eafbbc2feb1006fb3796d07dccaa695b612cc921546

See more details on using hashes here.

File details

Details for the file JT_Gmail-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: JT_Gmail-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for JT_Gmail-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0c95d8a911057b766b6c9d1fa2ac0f1f1d4bc5ca91f7c9d9340cd716ed0da8b
MD5 e0d262436b957e495b4cc1a080c1fe4c
BLAKE2b-256 a82735ca8c471e967feddc775fbecaefde7e475f80bab46f54873d21d21dfdd8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page