src.data
.pull_tweets
¶
-
src.data.
pull_tweets
( query , from_date , to_date , save_path , credentials_path , yaml_key , file_name = None , results_per_call = 500 , max_results = 3000 , verbose = False , ** kwargs ) [source] ¶ -
Pulls data (i.e., tweets and user info) from Twitter using its API. The data received from the API is stored in its original form (JSON) without performing any type of preprocessing.
- Parameters
-
- query str
-
Query passed to the Twitter API to fecth Tweets.
- from_date str or None
-
Date format as specified by convert_utc_time for the starting time of your search.
- to_date str or None
-
Date format as specified by convert_utc_time for the end time of your search.
- save_path str
-
Path where the raw data will be stored.
- credentials_path str
-
Path for the yaml file with the Twitter API credentials.
- yaml_key str
-
Key within the yaml file containing the Twitter API credentials to be used.
- file_name str or None, default=None
-
Name of the json file saved containing the data dump. If None, the named will be assigned as a function of query , from_date and to_date .
- results_per_call int, default=500
-
Number of Tweets returned per call.
- max_results int, default=3000
-
Maximum number of Tweets to be pulled.
- verbose int or bool, default=False
-
Controls the verbosity when pulling data.
- Returns
-
- None NoneType