Skip to main content

Package for counting messages from Facebook Messenger

Project description

Messenger Counter

Dependency status PyPI version PyPI downloads

Messenger Counter is a python script that counts messages from Facebook Messenger and shows various statistics.

If you are interested in contributing to this repository, pull requests are much appreciated.

Note: To use this software you need to download your data directly from Facebook (in JSON format). How to download my data?

Installation

pip install messenger-counter

CLI usage

  1. Count your messages using (insert path for your .zip file)
python -m mc count "facebook-YourName.zip"
  1. Add flag --chars or -c to count characters (optional)
python -m mc count -c "facebook-YourName.zip"
  1. Use following commands for different statistics (examples below)
python -m mc [-h] command [options]

Available commands:

  • count [-c] file — Counts all messages/characters and saves to messages.json or messages_chars.json file.
  • stats [-c] [converstion] — Displays statistics for counted messages. You can specify conversation for detailed statistics and use -c for character statistics.
  • user name — Detailed statistics for specific person
  • yearly file [conversation] — Number of messages per year. (please specify path to .zip file as for counting messages) You can specify conversation for more precise statistics.
  • daily [-d DIFF] file [conversation] — Number of messages daily. (use -d or --difference flag to time shift by some number of hours and show statistics differently)
  • hours [-d DIFF] file [conversation] — Average number of messages by hour throughout the day. (additional options as above)

Examples

Show general statistics of all conversations

python -m mc stats

Show messages statistics for specific conversation. (you can list all conversations by running previous example)

python -m mc stats JohnDoe

Program allows you to write only the beginning of the conversation name. It will return first matching occurrence. (Works exactly as the previous example)

python -m mc stats Joh

Shows how many messages did the person send grouped by conversation.

python -m mc user "John Doe"

Shows how many messages on average have you send and received grouped by time of the day.

python -m mc daily "facebook-YourName.zip"

Similar to previous one, but limited to one conversation.

python -m mc daily "facebook-YourName.zip" John

Basic module usage

Get started:

import MessengerCounter as mc
mc.set_source('facebook-YourName.zip') # insert path for your .zip file
mc.count()
mc.count(chars=True)
data = mc.get_data()
mc.statistics(*data)

How to download messages

  1. Select Settings & Privacy in the top right of Facebook, then click Settings.
  2. In the left column, click Your Facebook Information.
  3. Click on Download Your Information. fb1
  4. Deselect all and select "Messages" category by clicking the box on the right side.
  5. It is necessary to choose JSON format of your download request. fb2
  6. Click Create File to confirm the download request.
  7. Facebook will notify you when your copy will be ready to download.
  8. Go to the Available Files section.
  9. Click Download and enter your password.

Licence

Licence

Messenger Counter is licenced under MIT Licence.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

messenger_counter-0.5.1.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

messenger_counter-0.5.1-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page