Skip to main content

Utility for parsing Starcraft II replay files

Project description

What is sc2reader?

sc2reader is a library for extracting game information from Starcraft II replay files into a replay object. It is based heavily on documentation from the awesome phpsc2replay project.

Example Usage

>>> replay = Replay(filename)
>>> print "\n%s on %s played on %s" % (replay.type,replay.map,replay.date)
>>>
>>> #Player[0] is None so that players can be indexed by ID
>>> for team,players in replay.teams.iteritems():
>>>             print "\n\tTeam %s: %s" % (team,replay.results[team])
>>>             for player in players:
>>>                     print "\t\t%s" % player

2v2 on Zwietracht IV played on Mon Dec 27 22:51:59 2010

        Team 1: Won
                Player 1 - Pille (Zerg)
                Player 2 - Mort (Zerg)

        Team 2: Lost
                Player 3 - HaRib0 (Protoss)
                Player 4 - neosmatrix (Zerg)

The same results can be found using the sc2printer utility script which simply wraps up the above code as a (simple) demonstration of the libraries utility:

$ sc2printer game1.sc2replay game2.sc2replay

See the sc2replay wiki for additional usage details.

Current Status

sc2reader is written to parse replays where build version >= 16561. This means that the following information can be extracted:

  • Replay details (map, length, version, game type, game speed, …)

  • Player details (name, race, team, color, …)

  • Message details (text, time, player, target, …)

  • Game details (winners, losers, unit abilities,unit selections, …)

For version < 16561: replay, player, and message details can still be extracted because their formats do not seem to have changed as far as testing shows.

Support for older builds may be patched in future releases as development is on going.

Installation

Requirements

  • Python 2.6+, Python 3.0 untested

  • The mpyq MPQ exraction library

Basic Install

$ easy_install sc2reader
$ sc2printer 'path/to/replay.sc2replay'

Advanced Install

$ git clone https://github.com/GraylinKim/sc2reader.git
$ cd sc2reader
$ python setup.py install
$ sc2printer 'path/to/replay.sc2replay'

Issues and Support

Until some further infrastructure is set up:

  • Please refer to the wiki for documentation

  • Visit issue tracker to report bugs and request features

  • email me for technical support issues.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

sc2reader-0.1.0.zip (21.3 kB view details)

Uploaded Source

sc2reader-0.1.0.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sc2reader-0.1.0.win32.exe (215.6 kB view details)

Uploaded Source

File details

Details for the file sc2reader-0.1.0.zip.

File metadata

  • Download URL: sc2reader-0.1.0.zip
  • Upload date:
  • Size: 21.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sc2reader-0.1.0.zip
Algorithm Hash digest
SHA256 ee1b4c43b388d16884599a918257f85c9c1693571037553e62520ea5a256623c
MD5 8403ba803cf2e9e37185255f53714f2e
BLAKE2b-256 cba07639b43c07a8db96251701927ba359f2a6acb3f04a178bee621e26f390ab

See more details on using hashes here.

File details

Details for the file sc2reader-0.1.0.tar.gz.

File metadata

  • Download URL: sc2reader-0.1.0.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sc2reader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 49a1b80a62d228f2287b6eae98e6be0a8945c014c59c68e1119559bee7053cae
MD5 ca2302c6e3e42cbd190f2a48f5eb229d
BLAKE2b-256 28815588c9af694ce652cdda1073709855e900d37f929061ac4861bf7cb5469b

See more details on using hashes here.

File details

Details for the file sc2reader-0.1.0.win32.exe.

File metadata

  • Download URL: sc2reader-0.1.0.win32.exe
  • Upload date:
  • Size: 215.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sc2reader-0.1.0.win32.exe
Algorithm Hash digest
SHA256 7aeec926210c01f116a5e3e82c5da647c152544b6420b29cce8673a92fe7ab9b
MD5 3bfc84a4ca0936b83d607c3ed0b9cfb1
BLAKE2b-256 8772e4026f2a73057dbead903c7e76e816d473999078e2161724dd29c91751d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page