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.
The only requirement is Deno 1.0 or above. Install by following the official documentation.
After cloning the repository:
-
In your WhatsApp mobile app, from the chat screen, go to Options > More > Export chat
-
Place the exported
.txt
files in a folder in the project (i.e../data
folder). -
Copy
config.sample.json
asconfig.json
to the root of the project. -
Copy
events.sample.json
asevents.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.
-
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" }
- Run
sh run start
. - 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:
Commands have the following structure:
sh run <command>
Available commands:
start
to generate the stats and listen in port8000
for web version.fmt
to format code using Prettier with the default settings.test
to run the tests.
- 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