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
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)
docs
- Full documentation of snoozingmail module: https://snoozingmail.readthedocs.io/en/latest/
- The core gmail interfaces were based off of the python 2 Users.messages section of the Gmail api: https://developers.google.com/gmail/api/v1/reference/users/messages
Project details
Release history Release notifications | RSS feed
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.5.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for snoozingmail-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 295e0705a224177a6d04c8aaf9b064083386f424c95c3c2dcaeeb344a25d44b1 |
|
MD5 | 532eb4e07b97e8043e88472bb4d45cf8 |
|
BLAKE2b-256 | 760ca6770143555e8f48507234bc7a1c4321f1f04cc16b50bfe406ecea16773b |