Skip to content

Proo2005/python_automation_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail to Sheets Automation

📌 Project Overview

This project is a Python-based automation tool that connects to the Gmail API and Google Sheets API. It fetches real-time unread emails from a user's inbox, parses the relevant data (Sender, Subject, Date, Content), and logs them into a Google Sheet.

Sample Image

Sample Sample

🏗 Architecture

[Gmail Server] <-- (OAuth 2.0) --> [Python Script] <-- (OAuth 2.0) --> [Google Sheets] | | | (1. Fetch Unread) (2. Parse Data) (3. Append Row) | | (4. Mark as Read) ------------------------+

Flow:

  1. Auth: Script authenticates using OAuth 2.0 (User Credentials).
  2. Fetch: Requests only messages with label UNREAD.
  3. Parse: Decodes email body and extracts headers.
  4. Store: Appends data to Google Sheets.
  5. Update State: Marks email as READ in Gmail to prevent duplicate processing in future runs.

⚙️ Setup Instructions

Prerequisites

  • Python 3.x
  • Google Cloud Console Project with Gmail & Sheets APIs enabled.
  • credentials.json (OAuth Client ID).

Installation

  1. Clone the repository:

    git clone <your-repo-link>
    cd gmail-to-sheets
  2. Install Dependencies:

    pip install -r requirements.txt
  3. Configure Credentials:

    • Place your credentials.json file inside the credentials/ folder.
    • Note: This file is not included in the repo for security.
  4. Update Configuration:

    • Open config.py.
    • Add your SPREADSHEET_ID.

Usage

Run the main script:

python src/main.py

About

uses OAuth 2.0 checks unread emails of the user and stores it in an excwel file spearated by( semder , subject, body)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages