Giter Club home page Giter Club logo

gmail-api-and-sentiment-analysis's Introduction

Gmail-API-and-Sentiment-Analysis

Sends a request to Gmail API and shows subject of first five messages which might be congratulating the receiver.

Overview

This uses Gmail API call to return user's messages and then uses python's NLTK library for text parsing and returns the subject of the first five E-mails where the user is being congratulated.

Requirements Requirements to run the program are:-

Python 3.x
Pickle This comes installed with python package.
Gmail API call modules pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

nltk

  1. pip install -U nltk
  2. Open python interpreter
  3. Type nltk.download()
  4. From the dialog box, select choices and download

Gmail API

  1. Go to https://console.developers.google.com/
  2. In the top left corner of the page, click on "Select a project".
  3. In the dialog box that opens up, click on "New project" in the top right corner.
  4. Type your project name, and click select.
  5. Click on "Enable API and service" on the page that opens up.
  6. Type in "Gmail API" in the search bar and click on the result.
  7. In the resulting page, click on Enable API.
  8. Click on "CREATE CREDENTIALS" on the next page.
  9. On the next page, choose "Gmail API", then select "Other UI(e.g. Windows, CLI tool) and then after selecting the button with the label "User data" click on "What credentials do I need" and grant permission.
  10. In the new tab that open up, type in application name and click save.
  11. Switch back to the main window and make click "Refresh".
  12. After that, click on "Create OAuth Client ID".
  13. Download the client ID that is generated.
  14. Rename the file to "credentials.json" and move it to the folder where the python script congratlations.py is located.

Further Developments

Gmail API is very extensive but at the same time, very difficult to understand from the documentation.
I'll try and make python scripts for the major API calls as tutorial. And maybe sprinkle a bit of text analysis and machine learning.

Feel free to improve the given code or the readme. Ideas are always welcome!
Thanks for reading!
TPT

gmail-api-and-sentiment-analysis's People

Contributors

tpalawat avatar

Watchers

James Cloos 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.