<jupyter_start><jupyter_text>Example usage InstallationTo use `tweepypoll` in a project -   Begin by installing and importing tweepypoll, and optionally checking the version<jupyter_code>import tweepypoll

print(tweepypoll.__version__)<jupyter_output>0.1.0<jupyter_text>ImportsNext, import the functions:<jupyter_code>from tweepypoll.tweepypoll import get_poll_by_id
from tweepypoll.tweepypoll import get_polls_from_user
from tweepypoll.tweepypoll import visualize_poll<jupyter_output><empty_output><jupyter_text>Main functionsNow you are ready to use the main functionality!You may start by fetching tweet IDs for tweets with polls from a certain user, like so:  1. get_polls_from_user(username, tweet_num=5)This function returns a list of tweet IDs containing polls for a provided twitter username.<jupyter_code>get_polls_from_user('PollzOnTwitta', 7)<jupyter_output><empty_output><jupyter_text>As you can probably see, the first argument is the Twitter username, and the second argument is the number of polls you would like to fetch. The second argument is optional and defaults to 5.  2. get_poll_by_id(id)This function takes in the tweet id (for instance, fetched by get_polls_from_user() function documented above) and returns a dictionary with the following fields: (1) text of the tweet   (2) poll_options   (3) total_responses   (4) poll duration   (5) end date of the poll   (6) author's username<jupyter_code>get_poll_by_id(1239677278193438722)<jupyter_output><empty_output><jupyter_text>3. visualize_poll(poll_obj, show_user=False, show_duration=False, show_date=False)This function takes the poll object generated by get_poll_by_id() and returns a simple bar chart of poll responses. show_user, show_duration and show_date are optional arguments for displaying that information.<jupyter_code>poll = get_poll_by_id(1239677278193438722)
visualize_poll(poll, show_duration=True)<jupyter_output>The duration of the poll in hours: 168.0h
{'fraction_non_alphanumeric': 0.06012332990750257, 'fraction_numerical': 0.029290853031860225, 'mean_word_length': 7.392241379310345, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '474751', 'license': 'MIT', 'n_tokens_mistral': 654, 'n_tokens_neox': 601, 'n_words': 199, 'path': 'docs/example.ipynb', 'repo_name': 'UBC-MDS/tweepypoll', 'size': '1946'}