Skip to main content

A minimal python3 wrapper for the Gmail API

Project description

snoozingmail

A minimal python3 wrapper for the Gmail API that exposes basic message reading, modifying, and sending capabilities.

install

pip install snoozingmail

docs

usage

  • You'll first need to create a Cloud Platform project enabled with the python Gmail API, and download the credentials.json file. To do that follow Google's quickstart
  • Create a new Snoozin object with the path to your credentials.json file like so:
    snoozingmail.Snoozin("./credentials.json")
    
  • The first instantiation of Snoozin with your credentials.json file will prompt you to visit a url to pick what gmail account to give snoozin access to. A token.pickle file will be then be created for automatic authentication with the chosen account for future instantiations.

example

Print message body of first starred message in inbox

import snoozingmail

snoozin = snoozingmail.Snoozin("./credentials.json")
msg_ids = snoozin.get_labeled_msgs(['STARRED', 'INBOX'])
body_text = snoozin.get_msg_body(msg_ids[0])
print(body_text)

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

snoozingmail-0.0.4.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

snoozingmail-0.0.4-py3-none-any.whl (12.1 kB view details)

Uploaded Python 3

File details

Details for the file snoozingmail-0.0.4.tar.gz.

File metadata

  • Download URL: snoozingmail-0.0.4.tar.gz
  • Upload date:
  • Size: 6.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/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for snoozingmail-0.0.4.tar.gz
Algorithm Hash digest
SHA256 533ced829abe281a150ff649ede98e5a2f1356de32d8114f553912bfe31618a5
MD5 48f5bc7a7ee8902d389acbdd3a0e5f74
BLAKE2b-256 acf04fad98bdf6a6144ea4c913eb4e5640751d5dd0cb9883d1f3cd1b07f909ad

See more details on using hashes here.

File details

Details for the file snoozingmail-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: snoozingmail-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 12.1 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/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.0

File hashes

Hashes for snoozingmail-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2621c865fe7da1b7ec6f64cc6e690fcdeb0f6579bbc810358208b6cb1831e51
MD5 dd51a602786563ae6dd78f47ce6b940d
BLAKE2b-256 1a5c64f76c385cb8811c80effce5b82b0e0129ce0003d6ed3a83536e80590739

See more details on using hashes here.

Supported by

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