awpy

Discord Github Build Licence

awpy allows a user to parse, analyze and visualize Counter-Strike: Global Offensive (CSGO) demo files. You can visit the repository to view the source code, examples and data. Please join the Discord server if you would like to join our esports analytics community or to receive help with the library. To install the library, run pip install awpy (Python >= 3.9).

Using this library to parse CSGO demos is as easy as the few lines of code shown below. To see what output looks like, check out Example Parser JSON.

from awpy.parser import DemoParser

# Set the parse_rate equal to the tick rate at which you would like to parse the frames of the demo.
# This parameter only matters if parse_frames=True
# For reference, MM demos are usually 64 ticks, and pro/FACEIT demos are usually 128 ticks.
demo_parser = DemoParser(demofile="og-vs-natus-vincere-m1-dust2.dem",
                         demo_id="og-vs-natus-vincere",
                         parse_frames=True,
                         parse_rate=128)


# Parse the demofile, output results to dictionary with df name as key
data = demo_parser.parse()


# There are a variety of top level keys
# You can view game rounds and events in 'gameRounds']
data["matchID"]
data["clientName"]
data["mapName"]
data["tickRate"]
data["playbackTicks"]
data["playbackFramesCount"]
data["parsedToFrameIdx"]
data["parserParameters"]
data["serverVars"]
data["matchPhases"]
data["matchmakingRanks"]
data["playerConnections"]
data["gameRounds"] # From this value, you can extract player events via: data['gameRounds'][i]['kills'], etc.

# You can also parse the data into dataframes using
data_df = demo_parser.parse(return_type="df")

# The parser also writes a JSON file of the output named demo_id.json

Using awpy

Installation

How to install awpy.

Example Notebooks

Examples code and Jupyter notebooks to help get you started.

Projects

Projects that use awpy.

Frequently Asked Questions (FAQs)

Need help? Check the FAQs first.

License and Acknowledgments

License and acknowledgments.

awpy Modules

Analytics

Analytics module.

Data

Data module.

Parser

Parsing module.

Visualization

Visualization module.