Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Gmail API with Python (OAuth 2.0 Authentication)

This project demonstrates how to use the Gmail API with Python.
It covers the following:

  • Authenticate with OAuth 2.0 and save credentials locally.
  • Access Gmail labels using the API.
  • Send emails programmatically from Python.

Setup Instructions

1. Enable Gmail API and Download Credentials

  1. Go to the Google Cloud Console.
  2. Create a new project (or select an existing one).
  3. Navigate to APIs & Services → Library and enable the Gmail API.
  4. Go to APIs & Services → Credentials.
  5. Create OAuth 2.0 Client IDs credentials.
    • Application type: Desktop App
  6. Download the file as credentials.json and place it in your project directory.

2. Install Dependencies

Make sure you have Python 3.7+ installed. Install required libraries:

pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

About

Send and read Gmail emails using Python with OAuth 2.0 authentication

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages