An open API service indexing awesome lists of open source software.

https://github.com/brunozell/whatsappparser

Light-weight C# parser for exported WhatsApp chat histories
https://github.com/brunozell/whatsappparser

parser whatsapp

Last synced: about 1 month ago
JSON representation

Light-weight C# parser for exported WhatsApp chat histories

Awesome Lists containing this project

README

          

# WhatspApp chat history parser
A light-weight C# library that parses exported chat histories from WhatsApp.

[![NuGet](https://img.shields.io/nuget/v/BrunoZell.WhatsAppParser.svg)](https://www.nuget.org/packages/BrunoZell.WhatsAppParser)
![GitHub top language](https://img.shields.io/github/languages/top/BrunoZell/WhatsAppParser.svg)

``` c#
// Create a parser from an exported chat history
var parser = new Parser("chat.txt");

// Enumerate all messages in that history file
foreach (var message in parser.Messages()) {
Console.WriteLine($"{message.Timestamp:yyyy-MM-dd HH:mm} {message.Sender}: {message.Content}");
}
```

`Parser.Messages` is an enumerator, that means it will only read that many messages as you really need by leveraging the power of Linq.

It will return `Message` objects. They have three properties:

- **Timestamp** The point in time the message was sent down to the minute.
- **Sender** String representation of the message author. This can be the telephone number or the contact name behind this number.
- **Content** The actual message sent by the sender. This might be multi-line.

Be aware that history entries like encryption information or group invitations are ignored when parsing.