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
- Host: GitHub
- URL: https://github.com/brunozell/whatsappparser
- Owner: BrunoZell
- License: mit
- Created: 2018-11-02T00:50:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-11-05T04:16:36.000Z (over 7 years ago)
- Last Synced: 2024-03-28T18:37:48.648Z (about 2 years ago)
- Topics: parser, whatsapp
- Language: C#
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# WhatspApp chat history parser
A light-weight C# library that parses exported chat histories from WhatsApp.
[](https://www.nuget.org/packages/BrunoZell.WhatsAppParser)

``` 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.