Skip to content

siddheshsonawane07/jsonify_whatsapp_exports

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Chat Parser CLI

A simple command-line tool to convert WhatsApp chat exports into clean JSON format.

Features

  • Convert WhatsApp chat export files to JSON
  • Preserves message order and multi-line messages
  • Handles media message indicators
  • Simple command-line interface
  • Optional pretty-printing of output
  • Custom output file naming

Installation

npm install -g whatsapp-chat-parser-cli

Usage

Exporting WhatsApp Chat

  1. Open WhatsApp
  2. Open the chat you want to export
  3. Click the three dots menu (⋮)
  4. Select 'More' > 'Export chat'
  5. Choose 'Without media'
  6. Save the exported .txt file

Using the Parser

Basic usage:

whatsapp-parser chat.txt

With options:

whatsapp-parser chat.txt -o output.json -f

Command Line Options

  • -o, --output <path> - Specify output file path (default: chat-output.json)
  • -f, --format - Format JSON output (pretty print)
  • -h, --help - Display help information
  • -V, --version - Display version number

Output Format

The parser generates a JSON array where each element represents a message:

[
  {
    "sender": "John Doe",
    "message": "Hello world!"
  },
  {
    "sender": "Jane Smith",
    "message": "Hi there!"
  }
]

Examples

  1. Basic parsing: whatsapp-parser WhatsApp.txt
  2. Save to a specific file with pretty printing: whatsapp-parser WhatsApp.txt -o parsed-chat.json -f
  3. Display help: whatsapp-parser --help

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Known Limitations

  • Currently only supports the default WhatsApp export format
  • Media files are marked as "Media omitted" in the output
  • System messages (like "Messages and calls are end-to-end encrypted") are ignored

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Siddhesh Sonawane

Acknowledgments

  • Inspired by the need to analyze WhatsApp chat data
  • Built with Node.js and Commander.js

Support

For support, issues, or feature requests, please create an issue in the GitHub repository.

About

A simple command-line tool to convert WhatsApp chat exports into clean JSON format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published