Skip to content

How to use this library in your projects

headwinds edited this page Oct 27, 2014 · 3 revisions

Installation

From PyPi (mostly stable)

pip install spawningtool

From GitHub (less stable)

pip install -e git+git://github.com/StoicLoofah/spawningtool.git#egg=spawningtool

Usage

To execute it directly from the command line

python -m spawningtool PATH/TO/REPLAY

To execute it from within python

import spawningtool.parser
spawningtool.parser.parse_replay('PATH/TO/REPLAY')

To execute it as a module from within your python project:

  1. Copy the second spawningtool folder ( the one that contains the main.py file) into your project.
  2. You could then use spawningtool to help you build a replay model
import spawningtool
from spawningtool.parser import GameTimeline

class SpawningReplayModel():
 
  def loadRequestedReplay(self, filePath):
    result_replay = spawningtool.parser.parse_replay(filePath)
    return result_replay
Clone this wiki locally