class documentation

Handle data by writing it to a file.

Method __init__ The difference between the upper and lower date limits depends on whether Tweets are coming in an ascending date order (i.e. when streaming) or descending date order (i.e. when searching past Tweets).
Method do_continue Returns False if the client should stop fetching Tweets.
Method handle Write Twitter data as line-delimited JSON into one or more files.
Method on_finish Actions when the tweet limit has been reached
Method timestamped_file No summary
Instance Variable counter A flag to indicate to the client whether to stop fetching data given some condition (e.g., reaching a date limit).
Instance Variable fname Undocumented
Instance Variable fprefix Undocumented
Instance Variable gzip_compress Undocumented
Instance Variable output Undocumented
Instance Variable repeat Undocumented
Instance Variable startingup Undocumented
Instance Variable subdir Undocumented
Method _restart_file Undocumented

Inherited from TweetHandlerI:

Method check_date_limit Validate date limits.
Instance Variable do_stop Stores the id of the last fetched Tweet to handle pagination.
Instance Variable lower_date_limit Undocumented
Instance Variable upper_date_limit Undocumented

Inherited from BasicTweetHandler (via TweetHandlerI):

Instance Variable limit Undocumented
Instance Variable max_id Undocumented
def __init__(self, limit=2000, upper_date_limit=None, lower_date_limit=None, fprefix='tweets', subdir='twitter-files', repeat=False, gzip_compress=False): (source)

The difference between the upper and lower date limits depends on whether Tweets are coming in an ascending date order (i.e. when streaming) or descending date order (i.e. when searching past Tweets).

Parameters
limitUndocumented
upper_date_limitUndocumented
lower_date_limitUndocumented
fprefixUndocumented
subdirUndocumented
repeatUndocumented
gzip_compressif True, ouput files are compressed with gzip.
int limitnumber of data items to process in the current round of processing.
tuple upper_date_limitThe date at which to stop collecting new data. This should be entered as a tuple which can serve as the argument to datetime.datetime. E.g. upper_date_limit=(2015, 4, 1, 12, 40) for 12:30 pm on April 1 2015.
tuple lower_date_limitThe date at which to stop collecting new data. See upper_data_limit for formatting.
str fprefixThe prefix to use in creating file names for Tweet collections.
str subdirThe name of the directory where Tweet collection files should be stored.
bool repeatflag to determine whether multiple files should be written. If True, the length of each file will be set by the value of limit. See also handle.
def do_continue(self): (source)

Returns False if the client should stop fetching Tweets.

def handle(self, data): (source)

Write Twitter data as line-delimited JSON into one or more files.

Parameters
datatweet object returned by Twitter API
Returns
return False if processing should cease, otherwise return True.
def on_finish(self): (source)

Actions when the tweet limit has been reached

def timestamped_file(self): (source)
Returns
strtimestamped file name
counter: int = (source)

A flag to indicate to the client whether to stop fetching data given some condition (e.g., reaching a date limit).

Undocumented

Undocumented

gzip_compress = (source)

Undocumented

Undocumented

Undocumented

startingup: bool = (source)

Undocumented

def _restart_file(self): (source)

Undocumented