what?
Skype Chat Stats is a Python script that produces chat statistics from a Skype chat. Here is an example:
Chat statistics for 1.1.2007–31.12.2008 By message count: 8235 Al Bino 4925 Al Fresco 4111 Amanda Lynn 2947 Barb Dwyer 2904 Barry Cade 2881 Bea Minor 2852 Bill Board By text length: 404819 Bill Loney 328649 Billy Rubin 216267 Bud Light 175678 Dan D. Lyons 165080 Dick Bush 155606 Dick Tator 154309 Dilbert Pickles 134121 Don Key By posted links: 1063 Doug Graves 1038 Dr. Butcher 525 Dr. Kauff 403 Earl E. Bird 385 Fanny O'Rear 365 Gene Poole 341 Helen Back 316 Herb Rice Total traffic: 210 KB
why?
I made it because someone in a chat where I am said it would be cool.
Also I wanted to learn about current state of Skype4Py, date parsing and optparse.
get it
Download the script. You also need a template, here are my templates for English and Estonian.
You will also need some external libraries to be able to run this:
run it
You need to specify options on the command line to run the script. Just run "skypeChatStats.py -h" to get list of available commands. Here is the help output if you're too lazy to run it:
Usage: skypeChatStats.py [options]
Options:
-h, --help show this help message and exit
-s PERIODSTART, --start=PERIODSTART
Start date/time of the period you're analyzing
-e PERIODEND, --end=PERIODEND
End date/time of the period you're analyzing
-c CHATNAME, --chatname=CHATNAME
Chat identifier of the chat you are analyzing. Type
/CHATNAME in a Skype chat to get the name for that
chat.
-q, --quiet Don't show message processing progress on the console.
Use this if running automatically e.g as a cronjob
-d, --debug Whether to dump debugging info like message author,
timestamp and body as the processing is happening
Example command line to get all stats for January 2008 for a given chat.
skypeChatStats.p -s '2008-01-01 00:00:00' -e '2008-01-31 23:59:59' -c '#terminuz/$echo123;35ef55ddc4423432432aed51c'
The chat ID above is made up. Type "/SHOWNAME" (without the quotes) in a Skype chat that you are interested in, to get the chat ID. Then just copypaste it to the command line for this script.
The dates can be in any format that's parsable, the parsing module I use is quite powerful. You will want to have also the times in the manner shown above, so that the start and end dates are really correct. If you only had the date, it would mean 00:00:00 for that date and none of the messages from that day would actually be counted.
You can edit the template name on the last line of the script, if you want to use a different template filename.
customizing the template
The template is easily customizable using standard Django template language, see Django template reference for more.
known bug
Currently, non-ASCII characters seem to be stripped from the end of messages and displaynames. It looks like a bug in Skype4Py. See this thread for more.
