Skip to content

Simple processor of WhatsApp chat exports to generate stats, built as a weekend project to learn Deno.

License

Notifications You must be signed in to change notification settings

joaquingatica/chatstats

Repository files navigation

ChatStats

Overview

This project originated as a way to learn Deno, and get a fun outcome out of it.

It generates charts and statistics from a WhatsApp chat export, to visualize number of messages per week, referencing them to specified life milestones or events.

Requirements

The only requirement is Deno 1.0 or above. Install by following the official documentation.

Setup

After cloning the repository:

  1. In your WhatsApp mobile app, from the chat screen, go to Options > More > Export chat

    Chat Options Menu Chat Options > More Menu

  2. Place the exported .txt files in a folder in the project (i.e. ./data folder).

  3. Copy config.sample.json as config.json to the root of the project.

  4. Copy events.sample.json as events.json (can be placed inside ./data folder as well), and add or remove the relevant events if desired. For example:

    {
      "events": {
        "2020-03-10": "COVID-19 lockdown started."
      }
    }

    NOTE: Date format is YYYY-MM-DD.

  5. Update the configuration to match the desired data source folder and files, and the output file, for example:

    {
      "port": 8000,
      "sourceFiles": [
        "./data/chat-export-part1.txt",
        "./data/chat-export-part2.txt"
      ],
      "eventsSource": "./data/events.json",
      "outputPath": "./output/stats.json"
    }

Usage

  1. Run sh run start.
  2. Go to http://localhost:8000 to see the stats in charts.

The following is an example chart showing total messages per week, messages per author and events: Example Chart

Commands Reference

Commands have the following structure:

sh run <command>

Available commands:

  • start to generate the stats and listen in port 8000 for web version.
  • fmt to format code using Prettier with the default settings.
  • test to run the tests.

Notes & Disclaimers:

  • For now, the project in only developed for macOS for its sh usage. Minimal changes in scripts or usage for Windows and Linux need to be made.
  • Chat exports are expected to have the date and time format as mm/dd/yyyy, HH:MM.
  • Chat exports are expected to be exports without media, and it wasn't tested with other kind of exports

About

Simple processor of WhatsApp chat exports to generate stats, built as a weekend project to learn Deno.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published