Text Analysis_Python
This is a fun project as I use python and gmail API to grab all data of breakfast provided by our company. This dataset includes 180 day from the day I run the script (which is a parameter you can set it as any number as your wish).
Step 1:
Connect to Gmail account using python gmail API
Step 2:
Search all mails by related subjests
Step 3:
Data clean. Use NLTK to get the token, stem, strip and get rid of the stop words
Step 4:
Put all data to .csv file and save it to your local folder
Step 5:
Visualize data in Tableau to generate word clouds
Below is how it looks:
Develop Language: Python
Visualization tool: Tableau
Development Environment: Ipython
Main Libraries: imaplib, nltk, pandas
Step one: Connect to gmail (If your email asks for the two step certification, try to use the app password)
mail = imaplib.IMAP4_SSL('imap.gmail.com') mail.login(account,password) mail.select('inbox')
Step two: Get the email content and sent date
Step three:
Clean text and generate the csv file
Step four:
Vis it in Taleau
Let me put the reference site here first lol:
https://yuji.wordpress.com/2011/06/22/python-imaplib-imap-example-with-gmail/










