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.
- Go to the Google Cloud Console.
- Create a new project (or select an existing one).
- Navigate to APIs & Services → Library and enable the Gmail API.
- Go to APIs & Services → Credentials.
- Create OAuth 2.0 Client IDs credentials.
- Application type: Desktop App
- Download the file as
credentials.jsonand place it in your project directory.
Make sure you have Python 3.7+ installed. Install required libraries:
pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib