Skip to main content

My 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.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

JT_Gmail-0.0.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: JT_Gmail-0.0.2.tar.gz
  • Upload date:
  • Size: 3.2 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.2.tar.gz
Algorithm Hash digest
SHA256 9759b1d4a151aaccf988ba45d1eb533e31e7aa832a8a6ffcbf712cf8add0b73c
MD5 208e5c04cc236923331bade69593b750
BLAKE2b-256 3d66f58f0511190dddedde6123a1b875e4b96a4720a02f4bbf33a5f86d64c724

See more details on using hashes here.

File details

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

File metadata

  • Download URL: JT_Gmail-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 159544800e0290053f609c66761ac4d955211e03681310baf88ce9299973ce51
MD5 0587bd72baac3bb607942cbcace60eda
BLAKE2b-256 c05d146e8a798ceef39ff9327f11dcc719470e5f3d0eabafe66d9140352bf172

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