Awesome
<div align="center"> <h1>Awpy</h1> </div>Counter-Strike 2 Demo Parsing, Analytics and Visualization in Python
- :computer: Parse Counter-Strike demos in Python in one line.
- :skull: Access kill, damage, grenade, bomb, player trajectory data, and more
- :chart: Calculate common statistics, such as ADR, KAST, Rating and win probability
- šļø Visualize Counter-Strike data, including animated round gifs
- :speaker: Active Discord community
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 runpip install --upgrade awpy
. To check your current version, runpip 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.