Coder Social home page Coder Social logo

gmail-integration's Introduction

gmail-integration

This repository contains Python scripts for fetching emails and processing email rules. Below are the instructions for setting up the virtual environment and running the provided scripts using a Makefile or from a terminal.

Project Structure

  • conf: Holds files like config.yml, credentials.json, and rules.json.
  • src: Stores Python scripts.
  • tests: Includes Python unit & mocked e2e tests.
  • Makefile: Provides commands for convenient setup and script execution.
  • requirements.txt: Lists project dependencies.
  • requirements-test.txt: Lists test dependencies.

Pre-requisites

Make sure you have miniconda, make and PostgreSQL (if you are using local server) installed on your system. Python 3.10 or above is needed.

Setup

To create a Python virtual environment using miniconda, run:

make init

The install command installs the both project and test dependencies

make install

The test command executes mocked tests and generates a coverage report:

make test

IDE Configuration

To avoid import errors, mark the src directory as Sources Root and tests directory as Test Sources Root.
If you are using Pycharm, right click on the directory and then choose Mark Directory As.

Running Scripts

  • Follow the steps mentioned in Setting up OAuth 2.0 page to generate the client secret and store the json file as credentials.json under conf directory.
  • Modify the script configurable parameters as per your need which is located in conf/config.yml.
  • If you are using local PostgreSQL server, ensure the server is running. Please store the DB password in the environment variable POSTGRESQL_DB_PASSWORD.

Fetch Emails

To run the fetch emails script, execute the following command.

python src/fetch_emails.py

OR

make run_fetch_emails

Email Rule Processor

To run the email rule processor script, execute the following command.

python src/email_rule_processor.py

OR

make run_email_rule_processor

Reference

Gmail API Python Documentation

gmail-integration's People

Contributors

shanmugapriyansp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.