Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
255 commits
Select commit Hold shift + click to select a range
148f322
added no tracker events handling
jonomon Aug 1, 2013
f3ef915
Update creeptracker.py
jonomon Aug 1, 2013
7906de6
README/documentation updates.
GraylinKim Aug 12, 2013
5e4e94f
Update the change log and move links around.
GraylinKim Aug 13, 2013
b34be94
Small readme revisions.
GraylinKim Aug 13, 2013
768792d
Small additional changes for release.
GraylinKim Aug 13, 2013
fbda9eb
New v0.6.0 release.
GraylinKim Aug 13, 2013
0f5e949
Fix changelog formatting.
GraylinKim Aug 13, 2013
3f020da
seems to work OK
dsjoerg Aug 13, 2013
1c8e7e3
APMTracker needs to track APM for observers as well as players.
GraylinKim Aug 13, 2013
2b9c477
Make sure to process game events last.
GraylinKim Aug 13, 2013
3423130
Add regression test for event order.
GraylinKim Aug 13, 2013
e0feb86
Bump version to v0.6.1 [skip ci]
GraylinKim Aug 13, 2013
1c42c9a
Update changelog for v0.6.1 [skip ci]
GraylinKim Aug 13, 2013
bfef5be
fix more bugs eeccchhh
dsjoerg Aug 14, 2013
6de72a0
Remove dated download URL [skip ci].
GraylinKim Aug 16, 2013
82ad817
Better fix for hours/minutes on game length.
GraylinKim Aug 16, 2013
cc34ecf
Coverage reporting fix refs #145.
GraylinKim Aug 24, 2013
4e638e8
Fix FileCaching for python3.
GraylinKim Aug 24, 2013
380ab28
Attempt to fix coverage take 2.
GraylinKim Aug 24, 2013
7f448d8
Coverage fix take 3, use develop and not install.
GraylinKim Aug 24, 2013
9692db7
Small clarification on the unit.finished_at time.
GraylinKim Sep 1, 2013
79fe810
Substantial performance improvements.
GraylinKim Sep 1, 2013
e244c35
Fix the tutorial, thanks sil5555.
GraylinKim Sep 1, 2013
c89e58d
Fix up a lot of small issues in the tutorial.
GraylinKim Sep 1, 2013
8c8c908
When we have tracker events, don't change type with game events.
GraylinKim Sep 5, 2013
2622463
Register plugin exceptions as PluginExit events.
GraylinKim Sep 6, 2013
cba9d63
Bump to 0.6.2
GraylinKim Sep 6, 2013
f65122a
Properly handle hallucinated units. Fixes #153.
GraylinKim Sep 15, 2013
37b3924
Bump to 0.6.3.
GraylinKim Sep 15, 2013
78404df
Updates to the plugin documentation.
GraylinKim Sep 16, 2013
3416b04
Adjust tank supply cost. fixes #156.
GraylinKim Sep 18, 2013
1fb58be
Small unicode related fix.
GraylinKim Sep 21, 2013
6c0adc2
Consolidate and improve readers layer.
GraylinKim Sep 21, 2013
2d4bd6b
Bump version to 0.6.4.
GraylinKim Sep 22, 2013
dda41fb
Fix up event names and hierarchy.
GraylinKim Sep 22, 2013
24c0acf
Flesh out the ping class.
GraylinKim Sep 22, 2013
bb8f9d2
Misc. documentation improvements.
GraylinKim Sep 22, 2013
1d03283
First pass at replay resume support. refs #91
GraylinKim Sep 22, 2013
be7883c
dont assume player name is ascii
dsjoerg Nov 16, 2013
e672168
Remove unused player_names. closes #158.
GraylinKim Nov 17, 2013
a3153db
Remove map specific attributes from the listing.
GraylinKim Dec 2, 2013
6fb12e8
Raise an informative error on corrupt tracker file
GraylinKim Dec 2, 2013
caeb6ca
Fix python3 bug in plugin error handling routine.
GraylinKim Dec 2, 2013
2b35c07
Fixes #160 with non back compatible changes.
GraylinKim Dec 2, 2013
72da6ae
Remove some old % style string formatting.
GraylinKim Dec 2, 2013
6d13524
And this is why you run tests before pushing.
GraylinKim Dec 2, 2013
665cc12
Make note of the additional changes in the log.
GraylinKim Dec 2, 2013
1d9c141
adding a missing change from the list
StoicLoofah Dec 6, 2013
52e5be9
Merge pull request #163 from StoicLoofah/update-0.7-changelog
GraylinKim Dec 7, 2013
fe86668
Remove a couple more defunct replay attributes.
GraylinKim Dec 11, 2013
9283c33
Use generic UnitType and Ability classes for data.
GraylinKim Dec 11, 2013
4d068bf
datapacks is a better word than builds here.
GraylinKim Dec 11, 2013
0e6286f
Replace all references to gateway with region.
GraylinKim Dec 11, 2013
d9df519
Fix typo.
GraylinKim Dec 11, 2013
bd2a8cf
Use a regular dict for raw data results.
GraylinKim Dec 11, 2013
f58daf7
Remove stray reference.
GraylinKim Dec 11, 2013
b968b57
Misc import and documentation improvements.
GraylinKim Dec 11, 2013
81809e5
Don't forget the tests.
GraylinKim Dec 11, 2013
03bbdae
Our readers and lambdas can't be pickled.
GraylinKim Dec 11, 2013
b421a7c
Initial pass at PTR 2.1 support.
GraylinKim Dec 11, 2013
9c06d28
Initial pass at PTR 2.1 support.
GraylinKim Dec 11, 2013
50aa557
Fix small bugs in PTR support.
GraylinKim Dec 12, 2013
38dfa77
Fix small bugs in PTR support.
GraylinKim Dec 12, 2013
ba404a5
Clarify the highest leauge user attribute.
GraylinKim Dec 12, 2013
94263a5
The clan logo is a DepotFile location, not a string.
GraylinKim Dec 13, 2013
b6e6f82
The clan logo is a DepotFile location, not a string.
GraylinKim Dec 13, 2013
f012566
Fixes #165, properly parse mouse click events.
GraylinKim Dec 13, 2013
554b94d
Flesh out the ping class.
GraylinKim Sep 22, 2013
d3834e7
Misc. documentation improvements.
GraylinKim Sep 22, 2013
1c83190
Remove unused player_names. closes #158.
GraylinKim Nov 17, 2013
53498df
Remove map specific attributes from the listing.
GraylinKim Dec 2, 2013
760858a
Raise an informative error on corrupt tracker file
GraylinKim Dec 2, 2013
1094012
Fix python3 bug in plugin error handling routine.
GraylinKim Dec 2, 2013
f4fe8bb
Remove some old % style string formatting.
GraylinKim Dec 2, 2013
d21c50a
Remove a couple more defunct replay attributes.
GraylinKim Dec 11, 2013
e373ac4
Use generic UnitType and Ability classes for data.
GraylinKim Dec 11, 2013
23b36f5
datapacks is a better word than builds here.
GraylinKim Dec 11, 2013
e836c6a
Fix typo.
GraylinKim Dec 11, 2013
fc79bbb
Use a regular dict for raw data results.
GraylinKim Dec 11, 2013
a7c7e21
Misc import and documentation improvements.
GraylinKim Dec 11, 2013
3b0a9d5
Clarify the highest leauge user attribute.
GraylinKim Dec 12, 2013
b829379
Fixes #165, properly parse mouse click events.
GraylinKim Dec 13, 2013
e4fd231
Bring the changelog for 0.6.5 up to speed.
GraylinKim Dec 13, 2013
1a70911
Fix initdata parsing for base_build 23260 replays.
GraylinKim Dec 13, 2013
14c99b3
fix creepTracker so it runs as part of the test suite. and fix it to …
dsjoerg Dec 13, 2013
2f419eb
Updates to the project documentation.
GraylinKim Jul 31, 2013
aff260d
Small event documentation improvements.
GraylinKim Aug 1, 2013
ace3708
Better team string formatting.
GraylinKim Aug 5, 2013
78f4fe6
Improvements to documentation.
GraylinKim Aug 5, 2013
ea02352
Plugins can now yield PluginExit events.
GraylinKim Aug 6, 2013
94ec71b
More documentation changes.
GraylinKim Aug 6, 2013
3cc1cd0
Move get_real_type to utils.
GraylinKim Aug 7, 2013
1d497d8
Improve conflicting results message.
GraylinKim Aug 7, 2013
0bc00ce
GameHeart Plugin
StoicLoofah Aug 5, 2013
99bd6c1
GameHeart plugin as a GameEngine plugin.
GraylinKim Aug 7, 2013
23e82ab
GameHeart on by default.
GraylinKim Aug 7, 2013
9f6b076
Oops. Forgot the events file.
GraylinKim Aug 7, 2013
bcd0859
Fix broken function reference.
GraylinKim Aug 7, 2013
07617d1
Add a short guide to getting started.
GraylinKim Aug 7, 2013
b6adea4
Record the replay load_level for later.
GraylinKim Aug 12, 2013
20fe0cb
README/documentation updates.
GraylinKim Aug 12, 2013
27f40af
Update the change log and move links around.
GraylinKim Aug 13, 2013
aaab03f
Small readme revisions.
GraylinKim Aug 13, 2013
01b6164
Small additional changes for release.
GraylinKim Aug 13, 2013
170b484
New v0.6.0 release.
GraylinKim Aug 13, 2013
04988db
Fix changelog formatting.
GraylinKim Aug 13, 2013
1254505
APMTracker needs to track APM for observers as well as players.
GraylinKim Aug 13, 2013
c1f5d33
Make sure to process game events last.
GraylinKim Aug 13, 2013
1777d84
Add regression test for event order.
GraylinKim Aug 13, 2013
0c7f0b2
Bump version to v0.6.1 [skip ci]
GraylinKim Aug 13, 2013
041d2fc
Update changelog for v0.6.1 [skip ci]
GraylinKim Aug 13, 2013
68678bc
Remove dated download URL [skip ci].
GraylinKim Aug 16, 2013
daf9cd7
Better fix for hours/minutes on game length.
GraylinKim Aug 16, 2013
44a6106
Coverage reporting fix refs #145.
GraylinKim Aug 24, 2013
e3020d0
Fix FileCaching for python3.
GraylinKim Aug 24, 2013
b634e05
Attempt to fix coverage take 2.
GraylinKim Aug 24, 2013
6e19fe4
Coverage fix take 3, use develop and not install.
GraylinKim Aug 24, 2013
2f433cf
Small clarification on the unit.finished_at time.
GraylinKim Sep 1, 2013
33769ab
Substantial performance improvements.
GraylinKim Sep 1, 2013
ff28da2
Fix the tutorial, thanks sil5555.
GraylinKim Sep 1, 2013
1799249
Fix up a lot of small issues in the tutorial.
GraylinKim Sep 1, 2013
aaa2b89
When we have tracker events, don't change type with game events.
GraylinKim Sep 5, 2013
46ee535
Register plugin exceptions as PluginExit events.
GraylinKim Sep 6, 2013
50e3adc
Bump to 0.6.2
GraylinKim Sep 6, 2013
07c3eca
Properly handle hallucinated units. Fixes #153.
GraylinKim Sep 15, 2013
f2a7286
Bump to 0.6.3.
GraylinKim Sep 15, 2013
f3b0191
Updates to the plugin documentation.
GraylinKim Sep 16, 2013
088e2eb
Adjust tank supply cost. fixes #156.
GraylinKim Sep 18, 2013
3020b60
Consolidate and improve readers layer.
GraylinKim Sep 21, 2013
ec238c9
Bump version to 0.6.4.
GraylinKim Sep 22, 2013
b2aac81
Initial pass at PTR 2.1 support.
GraylinKim Dec 11, 2013
9ab207d
Fix small bugs in PTR support.
GraylinKim Dec 12, 2013
dcb3e8e
The clan logo is a DepotFile location, not a string.
GraylinKim Dec 13, 2013
af974eb
Flesh out the ping class.
GraylinKim Sep 22, 2013
3579d06
Misc. documentation improvements.
GraylinKim Sep 22, 2013
d443e7e
Remove unused player_names. closes #158.
GraylinKim Nov 17, 2013
28506b0
Remove map specific attributes from the listing.
GraylinKim Dec 2, 2013
49158d1
Raise an informative error on corrupt tracker file
GraylinKim Dec 2, 2013
e1f3d4e
Fix python3 bug in plugin error handling routine.
GraylinKim Dec 2, 2013
6e929cc
Remove some old % style string formatting.
GraylinKim Dec 2, 2013
f9cbeaa
Remove a couple more defunct replay attributes.
GraylinKim Dec 11, 2013
e3ff027
Use generic UnitType and Ability classes for data.
GraylinKim Dec 11, 2013
c4eea74
datapacks is a better word than builds here.
GraylinKim Dec 11, 2013
8a62df6
Fix typo.
GraylinKim Dec 11, 2013
74606f8
Use a regular dict for raw data results.
GraylinKim Dec 11, 2013
9564387
Misc import and documentation improvements.
GraylinKim Dec 11, 2013
8075ac4
Clarify the highest leauge user attribute.
GraylinKim Dec 12, 2013
b246755
Fixes #165, properly parse mouse click events.
GraylinKim Dec 13, 2013
79ddc88
Bring the changelog for 0.6.5 up to speed.
GraylinKim Dec 13, 2013
8179ff6
Fix initdata parsing for base_build 23260 replays.
GraylinKim Dec 13, 2013
5eea845
Add name to the CreepTracker plugin.
GraylinKim Dec 13, 2013
f5b1975
Fix a small rebase error, my bad.
GraylinKim Dec 13, 2013
4b45b62
Fix initdata parsing for base_build 23260 replays.
GraylinKim Dec 13, 2013
9949c9b
Add killer logic to ContextLoader, refine the API.
GraylinKim Dec 19, 2013
53e5678
Add killer logic to ContextLoader, refine the API.
GraylinKim Dec 19, 2013
3d34e4c
Update the changelog.
GraylinKim Dec 19, 2013
b8982c2
Merge branch 'v0.6.5' of http://github.com/GraylinKim/sc2reader into …
GraylinKim Dec 21, 2013
e5001a3
added a replay thats failing for GGTracker, but surprisingly it turns…
dsjoerg Jan 5, 2014
00411e3
Bump mpyq version.
GraylinKim Jan 8, 2014
04f06a1
workaround for objects that appear in selections but not in tracker e…
dsjoerg Jan 19, 2014
18ca54c
fix name of 'ControlGroupEvent' in comments
eqy Jan 30, 2014
a303fd7
Merge pull request #167 from eqy/patch-1
GraylinKim Jan 30, 2014
9277ec4
No more lints.
Apr 13, 2014
d275182
Merge pull request #168 from MakozFriends/master
GraylinKim Apr 15, 2014
214cd7c
Fixes SelectionTracker plugin with new handler names.
Apr 23, 2014
1a6220b
Merge pull request #169 from MakozFriends/hotfix/selectiontracker
GraylinKim May 5, 2014
846bfaf
fixes so that we can parse loaded games
dsjoerg Jun 23, 2014
b35d88c
new failing test for replays that started by loading a saved game
dsjoerg Jun 30, 2014
c860d8e
fix for replays that started with a load from a saved game
dsjoerg Jun 30, 2014
0988a58
2.1.4 now works hooray
dsjoerg Sep 23, 2014
762a8ab
test replay for 2.1.4
dsjoerg Sep 23, 2014
89f4eee
amended author info
dsjoerg Sep 26, 2014
6f30900
fix for 2.1.4
dsjoerg Sep 26, 2014
6580ebb
Fix various issues related to issue #180.
GraylinKim Dec 29, 2014
0dbe561
Fix gameheart plugin handling of teams and observers. Closes #174.
GraylinKim Dec 29, 2014
83d3809
Add option to print observers to sc2printer.
GraylinKim Dec 29, 2014
26c569e
Harden up the code for processing s2ma files.
GraylinKim Dec 29, 2014
6c48e8a
This is a polish translation.
GraylinKim Dec 29, 2014
a194b67
Remove PersonDict and AttributeDict implementations.
GraylinKim Dec 31, 2014
3e1cea3
Remove dead code.
GraylinKim Jan 5, 2015
722ae4f
Bump version to a pre-release (for clarity).
GraylinKim Jan 5, 2015
c5d22d6
decoding this so that it reads as a string not bytes in python 3
StoicLoofah Feb 11, 2015
4b3bd9b
Merge pull request #183 from StoicLoofah/decode_upgrade_type_name
GraylinKim Mar 3, 2015
20156ec
Fix ancient typo in struct decoder. refs #184
GraylinKim Mar 15, 2015
1ccc57c
beginning of LotV support. ported over from mainline.
dsjoerg Sep 15, 2015
69976fc
pil is required
dsjoerg Sep 15, 2015
109fbfc
for LotV, stop parsing the map info we can't read.
dsjoerg Sep 21, 2015
e48f306
LotV data from @StoicLoofah's branch
dsjoerg Sep 21, 2015
2139abc
remove debugging print statement
dsjoerg Oct 7, 2015
d69feb4
add failing test for 3.0
dsjoerg Oct 7, 2015
c6fdb74
handle 3.0 replays, work in progress.
dsjoerg Oct 7, 2015
ac8c220
further support for 3.0.
dsjoerg Oct 7, 2015
f6b54d4
add third replay for fun
dsjoerg Oct 7, 2015
0c9b272
read even less of the map data, because we can't read part of some ma…
dsjoerg Oct 7, 2015
ea6a7a1
hack to make HotS 3.0 / 38215 use the LotV datapack
dsjoerg Oct 8, 2015
7d12c2a
introduce failing test for 38749
dsjoerg Oct 28, 2015
64217c7
handle 38749. test passes now.
dsjoerg Oct 28, 2015
650a9cb
add a failing replay
dsjoerg Oct 30, 2015
b6d63e5
make diagnostic script not die when players don't have names
dsjoerg Oct 30, 2015
27948bf
correctly handle 38749. test passes now
dsjoerg Oct 30, 2015
ab8d826
make diagnostic script work
dsjoerg Oct 30, 2015
6a828a9
handle weird update_types in create_control_group_event. failing rep…
dsjoerg Nov 13, 2015
77d405f
handle 38996
dsjoerg Nov 13, 2015
a421ca0
handle 3.1.0. add test replays to prove it.
dsjoerg Dec 16, 2015
f2787f6
add instructions on running just one test
dsjoerg Dec 21, 2015
15c06f9
add test for the Central Protocol map which had a new kind of mineral…
dsjoerg Dec 21, 2015
e4240d9
add failing replay. no idea whats wrong
dsjoerg Jan 10, 2016
20b4544
new attributes. thx graylin for writing sc2attributes.py
dsjoerg Jan 10, 2016
333d027
add failing creepspread test
dsjoerg Feb 23, 2016
4eb4593
new failing test for 3.2
dsjoerg Apr 6, 2016
4d42147
fix for 3.2 (while breaking for older versions)
dsjoerg Apr 6, 2016
5e6e235
Use Pillow since pil is not available on Ubuntu 14.04.
nickelsen Apr 13, 2016
4be87ef
Fix LotV time by fps modifier (for length) and new game_speed_factors…
nickelsen Apr 14, 2016
504fff2
Merge pull request #9 from nickelsen/vagrant
dsjoerg Apr 15, 2016
b36791c
Merge pull request #10 from nickelsen/lotv-length-fix
dsjoerg Apr 17, 2016
73d11a9
Fix MapInfo parsing for version 0x26
gravelweb Apr 18, 2016
80ea580
Merge pull request #11 from gravelweb/mini-map
dsjoerg Apr 19, 2016
3bc825c
handle 3.3.0
dsjoerg May 18, 2016
189dcea
Fix some non-python 3 things
DasFranck May 21, 2016
5dbe62b
Adding StringIO import for Python3
DasFranck May 21, 2016
641e494
Run tests on circleci.
nickelsen Jun 9, 2016
32721d3
Merge pull request #15 from nickelsen/circleci
dsjoerg Jun 9, 2016
d5f5203
mark as expected a failure related to the APM from a HotS replay. it…
dsjoerg Jun 9, 2016
4b73007
tell CircleCI to ignore the branches that we know are old and busted
dsjoerg Jun 9, 2016
504fd5c
Merge branch 'upstream' into upstream
DasFranck Jun 9, 2016
bdf3bc2
Merge pull request #13 from DasFranck/upstream
dsjoerg Jun 10, 2016
90bc219
Add handler for command_update_target_unit_event
gravelweb Jun 9, 2016
9520a57
UpdateTargetAbilityEvent: Safer implementation, per player ability tr…
gravelweb Jun 11, 2016
9fd95ac
UpdateTargetAbilityEvent: Unit tests
gravelweb Jun 11, 2016
6fdaf29
Merge pull request #14 from gravelweb/update-target
dsjoerg Jun 11, 2016
32dec12
@mischanix wrote this back in Sept 2015 but I neglected to commit unt…
dsjoerg Jul 13, 2016
7df5941
fix usage message to have the right script name
dsjoerg Jul 13, 2016
cf67e1d
add new abilities and units for 3.4.0 (44401)
dsjoerg Jul 13, 2016
82fff8c
add test for 3.4.0. it passed before we did anything for it, and it s…
dsjoerg Jul 13, 2016
82887d9
register datapack so that the new ability info is actually used
dsjoerg Jul 13, 2016
2d36f82
44401 units, take 2
dsjoerg Jul 13, 2016
2f7bfcf
more units for unit lookup yay
dsjoerg Jul 13, 2016
a131d50
howto on how to do the abilities and units nonsense
dsjoerg Jul 13, 2016
ae41bda
handle 3.7
dsjoerg Oct 18, 2016
131ac4e
add another replay to the 3.7 test, works fine
dsjoerg Oct 18, 2016
dbffc7f
add new abilities and units for 47185
dsjoerg Oct 26, 2016
d5eb61a
Merge remote-tracking branch 'upstream/master' into ggtracker/upstream
StoicLoofah Nov 18, 2016
e6ca55b
fixing tests from graylinkim/ggtracker merge
StoicLoofah Nov 18, 2016
c86eb5a
fixing more references from the CHANGELOG
StoicLoofah Nov 28, 2016
f5fa1c5
Merge pull request #16 from StoicLoofah/reconcile_graylinkim_ggtracker
dsjoerg Dec 4, 2016
af4d492
bump to 0.8.0, update some URLs and contributor info
dsjoerg Dec 6, 2016
8cdc7d2
added support for protocol 48258
frugs Dec 11, 2016
afe0232
Merge pull request #17 from frugs/master
dsjoerg Dec 11, 2016
3730034
Remove unnecessary print statement
nibalizer Jan 19, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
README/documentation updates.
  • Loading branch information
GraylinKim committed Dec 13, 2013
commit 20fe0cbaf3ae95b1159474db395ba51e463e3923
207 changes: 93 additions & 114 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,51 +1,27 @@
What is sc2reader?
====================

sc2reader is a python library for extracting information from various different
Starcraft II resources. These resources currently include Replays, Maps, and
Game Summaries; we may eventually include BNet profiles and possibly adapters
to the more entrenched SCII sites like sc2ranks.
sc2reader is a python library for extracting information from various different Starcraft II resources. These resources currently include Replays, Maps, and Game Summaries; we have plans to add support for Battle.net profiles and would gladly accept adapters to the more entrenched SCII sites such as sc2ranks.

Our goal is to give anyone and everyone the power to construct their own
tools, do their own analysis, and hack on their own Starcraft II projects
under the open MIT license. Currently powering:
There is a pressing need in the SC2 community for better statistics, better analytics, better tools for organizing and searching replays. Better websites for sharing replays and hosting tournaments. These tools can't be created with out first being able to open up Starcraft II game files and analyze the data within. Our goal is to give anyone and everyone the power to construct their own tools, do their own analysis, and hack on their own Starcraft II projects under the open MIT license.

* Websites: `ggtracker.com`_, `gamereplays.org`_
* Tools: `The Core`_
* Experiments: `Midi Conversion`_

Our secondary goal is to become a reference implementation for people looking
to implement libraries in other languages. For replays, it implements the
replay format as specified in Blizzard's `s2protocol`_ project.

The following is a list of partial implementations in other languages:
Who Uses sc2reader?
======================

* C#: `sc2replay-csharp`_ (special thanks for v1.5 help)
* C++: `sc2pp`_
* Javascript: `comsat`_
* PHP: `phpsc2replay`_
sc2reader is currently powering:

Unfortunately sc2reader does not implement a battle.net scraper for profile
information. If you need the information I know of two projects that can get
you started:

* Ruby: `bnet_scraper`_ - Maintained by Agora Games
* Python: `sc2profile`_ - Currently unmaintained, slightly dated.
* Websites: `ggtracker.com`_, `gamereplays.org`_, `sc2companion.com`_
* Tools: `The Core`_
* Experiments: `Midi Conversion`_

If you'd like your tool, site, project, or implementation listed above, drop
us a line on our `mailing list`_ or stop by our #sc2reader IRC channel and say hi!
If you use sc2reader and you would like your tool, site, project, or implementation listed above, drop us a line on our `mailing list`_ or stop by our #sc2reader IRC channel and say hi!


Current Status
=================

sc2reader is currently capable of parsing varying levels of information out of
the three primary resource types listed below. For a more detailed and exact
description of the information that can be extracted please consult the
`documentation`_ hosted on Read the Docs.

The library is production ready and reasonably stable. `travis-ci`_ provides a
record of our `continuous testing`_ and `coveralls.io`_ provides a record of our `test coverage`_.
sc2reader is production ready at release and under active development on github. It is currently capable of parsing varying levels of information out of the three primary resource types listed below. For a more detailed and exact description of the information that can be extracted please consult the `documentation`_ hosted on ReadTheDocs.


Replays
Expand Down Expand Up @@ -90,22 +66,20 @@ in future releases.
Maps
-------

Maps are currently parsed in the most minimal way possible and are an area for
big improvement in the future. Currently the Minimap.tga packaged with the map
is made available along with Name, Author, Description for ONLY enUS localized
SCII map files. More robust Map meta data extraction will likely be added in
future releases.
Maps can be parsed for the following information:

* Minimap and Icon images (tga format)
* enUS localized Name, Author, Description, Website (if available)
* Map Dimensions, Camera Bounds, Tileset
* Player Slot data and Advanced Teams alliance/enemy data.

There's a lot more in here to be had for the adventurous.
There is a lot more in here to be had for the adventurous.


Game Summaries
-----------------

Game Summary files are downloaded by the client in order to allow you to view
the game summary from your match history. Prior to 2.0.8 they were the only
way to get the information from the summary screen. Since the 2.0.8 release
you have been able to compute this information yourself from the replay files.
Game Summary files are downloaded by the client in order to allow you to view the game summary from your match history. Prior to 2.0.8 they were the only way to get the information from the summary screen. Since the 2.0.8 release you have been able to compute this information yourself from the replay files.

Thank you Prillan and `Team Liquid`_ for helping to decode this file.

Expand All @@ -115,76 +89,92 @@ Thank you Prillan and `Team Liquid`_ for helping to decode this file.
* URLs to map localization files and images
* Player build orders up to 64 (real) actions

Parsing on these files is now production ready for those that can get them. See
the `Team Liquid`_ thread for details on how to go about getting them.
Parsing on these files is now production ready for those that can get them. See the `Team Liquid`_ thread for details on how to go about getting them.

Again, these files are generally unnecessary after the 2.0.8 release.



Example Usage
Basic Usage
=====================

To demonstrate how you might use sc2reader in practice I've included some short
contrived scripts below. For more elaborate examples, checkout the docs and the
`sc2reader.scripts`_ package on Github or in the source.
For examples scripts, checkout the docs and the `sc2reader.scripts`_ package on Github or in the source.

Loading Replays
-------------------
For many users, the most basic commands will handle all of their needs::

import sc2reader
replay = sc2reader.load_replay('MyReplay', load_map=true)

This will load all replay data and fix GameHeart games. In some cases, you don't need the full extent of the replay data. You can use the load level option to limit replay loading and improve load times::

Downloading Maps
--------------------
# Release version and game length info. Nothing else
sc2reader.load_replay('MyReplay.SC2Replay', load_level=0)

Save all the minimaps for all the games you've ever played::
# Also loads game details: map, speed, time played, etc
sc2reader.load_replay('MyReplay.SC2Replay', load_level=1)

import sc2reader, os, sys
# Also loads players and chat events:
sc2reader.load_replay('MyReplay.SC2Replay', load_level=2)

if not os.path.exists('minimaps'):
os.makedirs('minimaps')
# Also loads tracker events:
sc2reader.load_replay('MyReplay.SC2Replay', load_level=3)

# Only load details file (level 1) and fetch the map file from bnet
for replay in sc2reader.load_replays(sys.argv[1:], load_map=True, load_level=1):
minimap_path = os.path.join('minimaps', replay.map_name.replace(' ','_')+'.tga')
if not os.path.exists(minimap_path):
with open(minimap_path, 'w') as file_out:
file_out.write(replay.map.minimap)
print("Saved Map: {0} [{1}]".format(replay.map_name, replay.map_hash))
# Also loads game events:
sc2reader.load_replay('MyReplay.SC2Replay', load_level=4)

If you want to load a collection of replays, you can use the plural form. Loading resources in this way returns a replay generator::

Organizing Replays
----------------------
replays = sc2reader.load_replays('path/to/replay/directory')

Organizing your 1v1 replays by race played and matchup and sortable by length::

import sc2reader, os, shutil, sys
Loading Maps
----------------

sorted_base = 'sorted'
path_to_replays = 'my/replays'
If you have a replay and want the map file as well, sc2reader can download the corresponding map file and load it in one of two ways::

for replay in sc2reader.load_replays(sys.argv[1], load_level=2):
if replay.real_type != '1v1':
continue
replay = sc2reader.load_replay('MyReplay.SC2Replay', load_map=true)
replay.load_map()

try:
me = replay.player.name('ShadesofGray')
you = team[(me.team.number+1)%2].players[0]
If you are looking to only handle maps you can use the map specific load methods::

matchup = "{0}v{1}".format(me.play_race[0], you.play_race[1])
map = sc2reader.load_map('MyMap.SC2Map')
map = sc2reader.load_maps('path/to/maps/directory')

sorted_path = os.path.join(sorted_base,me.play_race[0],matchup)
if not os.path.exists(sorted_path):
os.makedirs(sorted_path)

filename = "{0} - {1}".format(replay.game_length, replay.filename)
src = os.join(path_to_replays,replay.filename)
dst = os.join(sorted_path, filename)
shutil.copyfile(src, dst)
Using the Cache
---------------------

If you are loading a lot of remote resources, you'll want to enable caching for sc2reader. Caching can be configured with the following environment variables:

* SC2READER_CACHE_DIR - Enables caching to file at the specified directory.
* SC2READER_CACHE_MAX_SIZE - Enables memory caching of resources with a maximum number of entries; not based on memory imprint!

You can set these from inside your script with the following code **BEFORE** importing the sc2reader module::

os.environ['SC2READER_CACHE_DIR'] = "path/to/local/cache"
os.environ['SC2READER_CACHE_MAX_SIZE'] = 100

# if you have imported sc2reader anywhere already this won't work
import sc2reader

except KeyError as e:
continue # A game I didn't play in!

Using Plugins
------------------

There are a growing number of community generated plugins that you can take advantage of in your project. See the article on `Creating GameEngine Plugins`_ for details on creating your own. To use these plugins you need to customize the game engine::

from sc2reader.engine.plugins import SelectionTracker, APMTracker
sc2reader.engine.register_plugin(SelectionTracker())
sc2reader.engine.register_plugin(APMTracker())

The :class:`~sc2reader.engine.plugins.ContextLoader` and :class:`~sc2reader.engine.plugins.GameHeartNormalizer` plugins are registered by default.


Installation
================

sc2reader runs on any system with Python 2.6+, 3.2+, or PyPy installed.


From PyPI (stable)
Expand All @@ -205,16 +195,17 @@ or with setuptools (specify a valid x.x.x)::
cd sc2reader-x.x.x
python setup.py install

Releases to PyPi can be very delayed, for the latest and greatest you are encouraged
to install from Github master which is **usually** kept quite stable.
Releases to PyPi can be very delayed, for the latest and greatest you are encouraged to install from Github master.


From Github
--------------------------

Github master is generally stable with development branches more unstable.

Install from the latest source on github with pip::
We use `travis-ci`_ to provide a record of our `continuous testing`_ and `coveralls.io`_ provides a record of our `test coverage`_. Please verify that tests are passing before installing development versions.

Install from the latest source on Github with pip::

pip install -e git+git://github.com/GraylinKim/sc2reader#egg=sc2reader

Expand All @@ -229,58 +220,43 @@ or with setuptools::
For Contributors
-------------------

Contributors should install from an active git repository using setuptools in
`develop`_ mode. This will install links to the live code so that local edits
are available to external modules automatically::
Contributors should install from an active git repository using setuptools in `develop`_ mode. This will install links to the live code so that local edits are available to external modules automatically::

git clone https://github.com/GraylinKim/sc2reader.git
cd sc2reader
python setup.py develop

Please review the CONTRIBUTING.md file and get in touch with us before doing
too much work. It'll make everyone happier in the long run.

Please review the `CONTRIBUTING.md`_ file and get in touch with us before doing too much work. It'll make everyone happier in the long run.

Testing
-------------------

We use the built in ``unittest`` module for testing. If you are still on Python
2.6 you will need to install ``unittest2`` because our test suite requires newer
features than are included in the main distribution.
We use the built in ``unittest`` module for testing. If you are still on Python 2.6 you will need to install ``unittest2`` because our test suite requires newer features than are included in the main distribution.

To run the tests just use::

python -m unittest discover test_replays
python -m unittest discover test_s2gs
python test_replays/test_all.py
python test_s2gs/test_all.py

When repeatedly running tests it can be very helpful to make sure you've
set a local cache directory to prevent long fetch times from battle.net::
When repeatedly running tests it can be very helpful to make sure you've set a local cache directory to prevent long fetch times from battle.net::

export SC2READER_CACHE_DIR=local_cache
# or
SC2READER_CACHE_DIR=local_cache py.test
SC2READER_CACHE_DIR=local_cache python test_replays/test_all.py

Good luck, have fun!


Community
==============

sc2reader has a small but growing community of people looking to make tools and
websites with Starcraft II data. If that sounds like something you'd like to be
a part of please join our underused `mailing list`_ and start a conversation
or stop by #sc2reader on FreeNode and say 'Hi'. We have members from all over
Europe, Australia, and the United States currently, so regardless of the time,
you can probably find someone to talk to.
sc2reader has a small but growing community of people looking to make tools and websites with Starcraft II data. If that sounds like something you'd like to be a part of please join our underused `mailing list`_ and start a conversation or stop by #sc2reader on FreeNode and say 'Hi'. We have members from all over Europe, Australia, and the United States currently, so regardless of the time, you can probably find someone to talk to.


Issues and Support
=====================

We have an `issue tracker`_ on Github that all bug reports and feature requests
should be directed to. We have a `mailing list`_ with Google Groups that you can
use to reach out for support. We are generally on FreeNode in the #sc2reader
and can generally provide live support and address issues there as well.
We have an `issue tracker`_ on Github that all bug reports and feature requests should be directed to. We have a `mailing list`_ with Google Groups that you can use to reach out for support. We are generally on FreeNode in the #sc2reader and can generally provide live support and address issues there as well.


Acknowledgements
Expand All @@ -297,7 +273,7 @@ and kept this project going.
* Thanks to `ggtracker.com`_ for sponsoring further development and providing
the thousands of test files used while adding s2gs and HotS support.
* Thanks to Blizzard for supporting development of 3rd party tools and releasing
their `s2protocol`_ reference implementation.
their `s2protocol`_ full reference implementation.


.. _s2protocol: https://github.com/Blizzard/s2protocol
Expand All @@ -324,3 +300,6 @@ and kept this project going.
.. _travis-ci: https://travis-ci.org/
.. _coveralls.io: https://coveralls.io
.. _test coverage: https://coveralls.io/r/GraylinKim/sc2reader
.. _CONTRIBUTING.md: https://github.com/GraylinKim/sc2reader/blob/master/CONTRIBUTING.md
.. _sc2companion.com: http://sc2companion.com
.. _Creating GameEngine Plugins: http://sc2reader.readthedocs.org/en/latest/articles/creatingagameengineplugin.html
Loading