Home

Awesome

<div align="center"> <h1>Awpy</h1>

Awpy Discord Awpy Downloads Build Documentation Status MIT License

</div>

Counter-Strike 2 Demo Parsing, Analytics and Visualization in Python

Installation

To install Awpy (it is currently in beta), you can run

pip install --pre awpy

[!NOTE] awpy requires Python >= 3.10. To update the library, just run pip install --upgrade awpy. To check your current version, run pip freeze | grep awpy.

[!TIP] Don't worry if you get stuck, visit us our Discord for help.

Example Code

Using Awpy is easy. Just find a demo you want to analyze and use the example below to get started. For example, take NaVi vs Virtus.pro.

from awpy import Demo

# Simply call `Demo(path="...")` to parse a demo
dem = Demo("natus-vincere-vs-virtus-pro-m1-overpass.dem")

# Access various dictionaries & dataframes
dem.header
dem.rounds
dem.grenades
dem.kills
dem.damages
dem.bomb
dem.smokes
dem.infernos
dem.weapon_fires
dem.ticks

[!TIP] Want to learn more about the parser output? Visit the parser primer in our documentation!

Help! The parser doesn't work or returns weird data

Counter-Strike demos can be a bit troublesome. It is likely you'll see increased error rates in POV demos. To help us address parsing issues, please open a bug report in our Github issues as well as in our our Discord. We're committed to increasing parsing coverage rates and appreciate any errors you may find.

Examples and Projects

Take a look at the following Jupyter notebooks provided in our examples/ directory. These will help you get started parsing and analyzing Counter-Strike data.

If you use the parser for any public analysis, we kindly ask you to link to the Awpy repository, so that others may know how you parsed, analyzed or visualized your data. If you have a paper or project that uses the parser, please let us know in Discord so we can add it to our growing list!

Contributing

We welcome any contributions from the community, no matter the skill-level. You can visit our issue page to see what issues are still open, the Awpy project for a different view of project priorities, or you can message us on Discord. Some examples of where you can make a difference are in documentation, quality assurance, developing new features, or creating unique content with Awpy. You can see more examples of community content here. If you are interested in contributing to Awpy, learn more here.

[!TIP] We are happy to walk through those that want to contribute, no matter your skill level. There are a diverse set of ways one can contribute to Awpy. We welcome first-time contributors.

Structure

Awpy is structured as follows:

.
ā”œā”€ā”€ awpy
ā”‚Ā Ā  ā”œā”€ā”€ data                      # Data directory (PLANNED)
ā”‚Ā Ā  ā”œā”€ā”€ stats                     # Stats and analytics module
ā”‚Ā Ā  ā””ā”€ā”€ visualization             # Visualization module (PLANNED)
ā”‚Ā Ā  converters.py                 # Utilities for converting to readable strings
ā”‚Ā Ā  demo.py                       # Defines the base Demo class
ā”‚Ā Ā  parsers.py                    # Defines simple parsers for different events
ā”‚Ā Ā  utils.py                      # Utilities used across the project
ā”œā”€ā”€ doc                           # Documentation files
ā”œā”€ā”€ examples                      # Jupyter Notebooks showing example code
ā””ā”€ā”€ tests                         # Tests

Acknowledgments

The name "Awpy" is due to Nick Wan -- we recommend his stream for sports data analytics enthusiasts.

Awpy was first built on the amazing work done in the demoinfocs-golang Golang library. We now rely on demoparser2 for parsing, which is another fantastic parsing project, built specifically for Python.