Well it’s been a long, long time since I’ve last posted, so here’s a post on a project I’ve been working on for the past month, pyreplib.
pyreplib is a Python library to read Starcraft and Brood War replay files. A replay file is basically just a big list of all the actions executed by all the players during a game with some additional information such as the player names, races, the map used, etc.
A replay file is compressed, but thanks to jca, I was able to use his unpack.c module to do that task for me. Basically, I unpack the replay with C, I put the content in Python strings (with the Python C API) and use them from my Python library.
The library is not finished at the moment, I haven’t even made a release, but you can already get it from Subversion on Google Code. I want to try and make it a little more solid before I do a first official release. People ask me what I want to do with it. Basically, I’d want to try and do a web site similar to RepDepot, but in Django. Also, I would make the stats (APM, unit and building distribution, etc.) images that can easily be linked on other sites instead of a Flash applet. pyreplib also has a repdumper utility to dump the data in JSON, XML and YAML. Although all three work, YAML is not recommended as it is very slow (more than one minute to dump a replay on my machine.) With cjson, JSON dumping can be done in less than one second, XML dump takes about 2.5 seconds.
If you have comments on the project, suggestions or even patches, be sure to send them my way.
Posted by gnuvince