twitterpersona.load_twitter_msg

Module Contents

Functions

user_info(consumer_key_input, consumer_secret_input, ...)

Take four input parameters with user credentials and stored in a list object.

load_twitter_by_user(user, limit, user_info)

Load dataframe which contains specific user and return as a dataframe with total tweets.

load_twitter_by_keywords(key, limit, user_info)

Load dataframe which contains specific user and return as a dataframe with total tweets.

twitterpersona.load_twitter_msg.user_info(consumer_key_input, consumer_secret_input, access_token_input, access_token_secret_input)[source]

Take four input parameters with user credentials and stored in a list object. :param consumer_key_input: twitter consumer key. :type consumer_key_input: str :param consumer_secret_input: twitter consumer secret. :type consumer_secret_input: str :param access_token_input: twitter token. :type access_token_input: str :param access_token_secret_input: twitter token secret. :type access_token_secret_input: str

Returns:

user_info – list contains above user info.

Return type:

list

Examples

user_info(‘consumer_key_input’, ‘consumer_secret_input’, ‘access_token_input’, ‘access_token_secret_input’)

twitterpersona.load_twitter_msg.load_twitter_by_user(user, limit, user_info)[source]

Load dataframe which contains specific user and return as a dataframe with total tweets. :param user: Twitter user_name. :type user: str :param limit: How many tweets you wanna return. :type limit: int

Returns:

Dataframe contains username’s twitter info.

Return type:

pd.DataFrame

Examples

load_twitter_by_user(‘Cristiano’, 300)

twitterpersona.load_twitter_msg.load_twitter_by_keywords(key, limit, user_info)[source]

Load dataframe which contains specific user and return as a dataframe with total tweets. :param key: tweets keyword. :type key: str :param limit: how many tweets you wanna return. :type limit: int

Returns:

dataframe contains username’s twitter info.

Return type:

dataframe

Examples

load_twitter_by_keywords(‘2022’, 100)