A tool to generate a daily digest of your Gmail inbox. Helpful if you have agents working on your behalf.
Project description
Gmail Digest
Installation
pip install -U gmail-digest
Usage
Usage: gmail-digest [OPTIONS]
Options:
--dry-run Run script without creating sending
--help Show this message and exit.
Extra filte
You can customize the gmail query used to collect emails to summarize:
GMAIL_FILTER_SUFFIX=-to:personal@gmail.com -to:readwise.io -to:todoist.com
Development
Test the tool by running it locally and increasing DIGEST_DAYS
.
Need to debug OpenAI/prompt issues? Enable debug logging.
Setup
You need to create a "OAuth 2.0 Client IDs" which has to be done with a Google Workspace (gsuite). This will not work on a personal gmail account (unless you create a app on a workspace and add your personal account as a test account).
Generating a Gmail API Token
- Navigate to the Google Cloud Console. https://console.developers.google.com/
- Create a new project or select an existing one.
- Go to "APIs & Services" -> "Library" and enable the Gmail API.
- Navigate to "APIs & Services" -> "Credentials".
- Click "Create Credentials" -> "OAuth client ID".
- Select "Desktop app" as the application type, then click "Create".
- Download the JSON file, rename it to
credentials.json
, and place it in the root of this project. - Run the script and oauth into your account
If you want to edit scopes on an existing application, you can:
- OAuth Consent Screen
- Edit
- Continue to step 2
- Add or remove scopes
- Add scopes and save
Credential Scopes Needed
Two main scopes are required for this:
https://www.googleapis.com/auth/gmail.compose
https://www.googleapis.com/auth/gmail.readonly
Some other scopes I'd add so you can reuse the credentials in other projects, like gmailctl or calendar scripts:
https://www.googleapis.com/auth/calendar.readonly
https://www.googleapis.com/auth/calendar.event
https://www.googleapis.com/auth/gmail.labels
https://www.googleapis.com/auth/gmail.settings.basic
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
Built Distribution
File details
Details for the file gmail_digest-1.4.2.tar.gz
.
File metadata
- Download URL: gmail_digest-1.4.2.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5fe70a01ee8adc5fc6c317d227ab5beafe96ede602cf11d5580eb207fda4cd1 |
|
MD5 | c2313a192c566243998669ca471f8ff0 |
|
BLAKE2b-256 | 0adfb9d3ab5549375df9bc6d67a1f10718c9ce8332da9269a485cfde496caf53 |
File details
Details for the file gmail_digest-1.4.2-py3-none-any.whl
.
File metadata
- Download URL: gmail_digest-1.4.2-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Linux/6.5.0-1025-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88e7d3123bb9bdb0f4313dd212176696e3b4567bb569d5ae293a7fe24fca6a32 |
|
MD5 | 8ea33cb3f91bb667c3fca192dfc25a02 |
|
BLAKE2b-256 | e45a1f998a50692c2876bd4871bb75648f2ae60850f9df6947d57ea6051b2fc5 |