Coder Social home page Coder Social logo

whatsapp-parser's Introduction

whatsapp-parser

Parser to the What's App log file. Feel free to fork and modify :-)

Dependencies

  • Python 2.*

Input

A Whatsapp chat history file and an optional list of regular expression patterns.

Output

  • Several statistics about the chat history and the frequency of each pattern.
  • A JSON file is created inside /logs/ folder.

Usage Steps

  • Export your Whatsapp chat history. (http://www.whatsapp.com/faq/general/23753886)
  • Clone this repository.
  • For simplicity, put the chat history file in the same folder of the cloned repository.
  • Open your terminal and execute:
python chat.py -f chat.txt -p WhatsApp -n "Nikolas Moya" -r [regex. patterns]

Example

python chat.py -f chat.txt -p WhatsApp -n "Nikolas Moya" -r sleepy yes
  • Expected output:
--PROPORTIONS
 total_messages -> 32773
 total_words -> 172760
 total_chars -> 899435
 messages
   Marilia Ferreira -> 16234
   ‪Nikolas Moya -> 16539
 words
   ‪Nikolas Moya -> 72797
   Marilia Ferreira -> 99963
 chars
   ‪Nikolas Moya -> 379642
   Marilia Ferreira -> 519793

--SHIFTS
 morning -> 2581
 afternoon -> 6593
 evening -> 9736
 latenight -> 13863

--WEEKDAY
 Wednesday -> 4155
 Thursday -> 4319
 Monday -> 4638
 Saturday -> 4650
 Tuesday -> 4730
 Friday -> 4874
 Sunday -> 5407

--AVERAGE MESSAGE LENGTH
 ‪Nikolas Moya -> 4.40153576395
 Marilia Ferreira -> 6.1576321301

--PATTERNS
  sleepy
   ‪Nikolas Moya -> 10
   Marilia Ferreira -> 5
 yes
   ‪Nikolas Moya -> 98
   Marilia Ferreira -> 87

--TOP 15 MOST USED WORDS (length >= 3)
não
amor
mais
hahaha
sim
muito
isso
amo
para
tudo
hahah
acho
agora
aqui
tava
./logs/Chat.txt.json

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.