Given the frequency that I have seen database languages listed as a requirement for data science jobs, I thought it would be a good idea to do a practice project on MySQL today. In particular, I wanted to look at how we can use python and an API to stream data directly into a MySQL database.
Install SQL Server and setup your MySQL workbench. There are a lot of tutorials on this. I found this in particular very useful.
Before we access the Twitter API you need to set up a twitter app.
- go to the following website click here and create an account.
- Once you have verified your email you can log into your account. You should be able to create a new app on the following webpage: click here
- Fill in all the details about your app and then create your access token.
- Make a note of your consumer key, consumer secret, OAuth access token and OAuth access token secret. These are needed to connect to the API.
I have used placeholders in my code where you'll be putting your tokens in order to access the API.