Skip to main content

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.

Metadata

Release files for messenger-counter 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for messenger-counter 0.5.1
File Size Uploaded Provenance Actions
messenger_counter-0.5.1.tar.gz 9.2 kB Without provenance Details for messenger_counter-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for messenger-counter 0.5.1
File Interpreter ABI Platform Actions
messenger_counter-0.5.1-py3-none-any.whl Python 3 none any Details for messenger_counter-0.5.1-py3-none-any.whl

Total release size: 18.1 kB

Release files / messenger_counter-0.5.1.tar.gz

Download URL messenger_counter-0.5.1.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f91443a015e5983306d2bfc06060ef8bf58a6f6c0df85fee1f54590a7416e2d7
BLAKE2b-256 checksum
How to use checksums
7965d8cf7960e86483b132876059d8db2c54f21e7e5c255b10c9767e01f23167
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.2

Release files / messenger_counter-0.5.1-py3-none-any.whl

Download URL messenger_counter-0.5.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e484c1155ef3da63e9022313bf0c5bbd90d6a29a39bfd438278b6761c8813518
BLAKE2b-256 checksum
How to use checksums
3d3c2575c4f00450445acd6a29ae13e70871eff2dbc47663056eb4d88403f57e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.25.2

Security for messenger-counter 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page