13.7 Authenticating with Twitter Via Tweepy

In the next several sections, you’ll invoke various cloud-based Twitter APIs via Tweepy. Here you’ll begin by using Tweepy to authenticate with Twitter and create a Tweepy API object, which is your gateway to using the Twitter APIs over the Internet. In subsequent sections, you’ll work with various Twitter APIs by invoking methods on your API object.

Before you can invoke any Twitter API, you must use your API key, API secret key, access token and access token secret to authenticate with Twitter.8 Launch IPython from the ch13 examples folder, then import the tweepy module and the keys.py file that you modified earlier in this chapter. You can import any .py file as a module by using the file’s name ...

Get Intro to Python for Computer Science and Data Science: Learning to Program with AI, Big Data and The Cloud 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.