Jinja2

Day Grouping in the Chat Log Parser!

Finally, I’ve added a feature to my chat log parser to group messages by day. It’s something I’ve wanted to be able to do for a while now. This took a bit of work to add a new data structure and update the HTML Jinja2 templates. But now the base of it is done and if I want, I can customise the styles.

Screenshot of Chat Log with day grouping

Oh hey Sunny!

Originally, I tried to do the day grouping inside the Jinja2 templates, but this proved rather difficult – I ended up spending hours in the library trying to work out nested loops inside a templating language. Eventually, I realised I should perform the day grouping on the data structure instead, so I just loop over each day, then created the minute bundles inside.

Technical Info!

Creating the day grouping in the ChatLog data structure turned out to be surprisingly easy:

Continue reading →

Posted by Anthony in chat log parser

Urban Dictionary Analysis Tool

A fun little exercise I’ve been doing is a statistical and language analysis tool to analyse Urban Dictionary.  The idea for the project came about when it was pointed out that my own name was on UD and I realised that many of the definitions were of a sexual nature or offering praise to the holder of the name. I suspect that people are adding definitions of either their own name, or their partners or relatives. I thought it would be fun to programmatically analyse the various definitions and group them by content, maybe also ranking the most popular keywords or other interesting statistics.

The finished (though I’ll add to it overtime) product is available here: https://www.acarrick.com/urban_stats

screenshot of Urban Stats tool.

Continue reading for some technical details….

Continue reading →

Posted by Anthony

Short Project: Chat Log Parser

I’m using Viber to communicate with someone, and we have many chats. So I looked into Viber’s chat backup capability. I found that Viber has two backups — one that you can restore, and one that you can email. It turns out that the email-able backup is actually in CSV. And so I realised I could parse it very easily with Python; and use a templating module such as Jinja2 or Mako, format it into an easy to read HTML page.

Continue reading →

Posted by Anthony in chat log parser