Package: zucked
zucked: analyze your Facebook Messenger dataWhat is it?zucked is a quick and easy way to veiw your facebook messenger data.Main FeaturesEasy viewing of your most used words on Facebook MessengerSee another facebook users most sent words to youCheck the amount of messages you have sent a person or groupSearch a word or phrase that you might have sent or recieved to see: The message the word or phrase was in, as well as who sent it and when the message was sentInstallThe source code is currently hosted on GitHub at:https://github.com/Jordan-Milne/zuckedThe latest released version is available at thePython package index (PyPI)pip install zuckedTutorialDownlaod your Facebook Messenger data (How to)When choosing file type make sure it is JSON and not HTMLCreate a python file in thesame directoryas the "inbox" folder from your download -not insidethe inbox folderImportTo import zucked, type:import zucked as zdread_messagessaveread_messagesas a variable, which we will be calling methods on later.Example:ms = zd.read_messagestop_words()calltop_words(facebook_name, stop_words=True, period='all time')onmsto return an ordered list of the most common words the user sent and how many times they sent it:This method works for top words you have sentandtop words you have recieved from a certain userExample:ms.top_words('Jordan Milne')Returns:[('I', 3), ('love', 2), ('data', 1)]If you want stop words filtered out, (what are stop words) and just the top words for a certain year then the method would simply be:ms.top_words('Jordan Milne', stop_words=False, period='2016')top_convoscalltop_convos(facebook_name)onmsto return an ordered list of the name(s) of the person or group and the amount of messages you sent to that person or group:Example:ms.top_convos('Jordan Milne')Returns:[('User 1', 33),
 ('User 2', 21)]If you want the top conversations for a certain year then the method would simply be:ms.top_words('Jordan Milne', period='2016')search_messages()callsearch_messages(facebook_name, value)onmsto return a list that has the full message containing the word or phrase input asvalue, who the message was sent to, and the date and time the message was sent.Example:ms.search_messages('Jordan Milne', 'hello')Returns:[{'Message': 'I'm sorry but, hello world',
  'Sent to': 'Auston Matthews',
  'Date': '2019-06-09 11:46:54'}]This method works for messages you have sentandmessages you have recieved from a certain userformat_top_words()callformat_top_words(facebook_name, input_list, year)onmsto return a nested dictionary with the year and counts of the list of words that the user inputs that is specifically formatted for plotting.Example:ms.format_top_words('Jordan Milne', ['Matthews','Tavares','Marner','Andersen'], '2019')Returns:{'2019': {'Matthews': 75, 'Andersen': 70, 'Marner': 17, 'Tavares': 10}}Now for the fun part. If you want to see how often you used your top 5 all time words each year it can be done in a few simple steps.Get all years into the same dictionary using this for loop:example={}
for i in range(2010,2021):
    example.update(ms.format_top_words('Jordan Milne',['Matthews','Tavares','Marner','Andersen'], str(i)))Now that we have the data collected and organized we are ready to plot:import matplotlib.pyplot as plt

# get inner keys
inner_keys = list(example.values())[0].keys()

# x-axis is the outer keys
x_axis_values = list(example.keys())

# loop through inner_keys
plt.title("Facebook Messenger Word Count")
plt.xlabel("Year")
plt.ylabel("Count");
for x in inner_keys:

    # create a list of values for inner key
    y_axis_values = [v[x] for v in example.values()]

    # plot each inner key
    plt.plot(x_axis_values, y_axis_values, label=x)
    plt.legend()The ouput should look like: