Collecting data from Twitter

In order to interact with the Twitter APIs, we need a Python client that implements the different calls to the API itself. There are several options as we can see from the official documentation (https://dev.twitter.com/overview/api/twitter-libraries). None of them are officially maintained by Twitter and they are backed by the open source community. While there are several options to choose from, some of them almost equivalent, so we will choose to use Tweepy here as it offers a wider support for different features and is actively maintained.

The library can be installed via pip:

$ pip install tweepy==3.3.0 

Tip

Python 3 compatibility

We're specifically installing version 3.3 of Tweepy, because of an issue with the ...

Get Mastering Social Media Mining with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.