Skip to main content

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.

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

  1. Navigate to the Google Cloud Console. https://console.developers.google.com/
  2. Create a new project or select an existing one.
  3. Go to "APIs & Services" -> "Library" and enable the Gmail API.
  4. Navigate to "APIs & Services" -> "Credentials".
  5. Click "Create Credentials" -> "OAuth client ID".
  6. Select "Desktop app" as the application type, then click "Create".
  7. Download the JSON file, rename it to credentials.json, and place it in the root of this project.
  8. Run the script and oauth into your account

If you want to edit scopes on an existing application, you can:

  1. OAuth Consent Screen
  2. Edit
  3. Continue to step 2
  4. Add or remove scopes
  5. 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


Download files

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

Source Distribution

gmail_digest-1.2.3.tar.gz (7.1 kB view hashes)

Uploaded Source

Built Distribution

gmail_digest-1.2.3-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

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