Twitter can be used as a data source for various data science projects, including Geo-spatial analysis (where are users tweeting about certain subjects?) and sentiment analysis (how do users feel about certain subjects?).

I decided to build a dashboard that combines the two questions using the example of UK political leaders; Boris Johnson and Keir Starmer. However it’s possible to use any combination of keywords to analyse political figures, companies etc.

We can break down what needs to be done into three distinct areas:

  1. Database set-up: This can be done directly in the RDBMS of your choice, however we choose to use SQLAlchemy in this example.
  2. Tweepy: Credentials are required to interact with the Tweepy API. Once these have been obtained we can set up a stream with keyword filters.
  3. Streamlit: Once we have our data stream working we’ll need to set up our web app using Streamlit. This is surprisingly simple and can be done within a single python file!

This article will work through each point above and show how they interact.

#python #tweepy #mysql #streamlit

Building a Live Tweet Dashboard using Tweepy, MySQL and Streamlit
1.75 GEEK