Skip to main content

Counter-Strike 2 demo parsing, analysis and visualization

Project description

Awpy

Awpy Discord Awpy Downloads Build Artifacts Documentation Status MIT License

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

  • :computer: Parse Counter-Strike demos in Python or with a command-line interface
  • :skull: Access tick-level player and event data, like kills, damages and more
  • :chart: Calculate popular statistics, such as ADR, KAST and Rating
  • :mag_right: Determine player visibility in microseconds
  • :earth_americas: Parse navigation meshes (.nav) and calculate distance metrics
  • 🎞️ Visualize Counter-Strike data, including animated round gifs and heatmaps
  • :speaker: Active Discord community

Installation

To install Awpy, you can run

pip install awpy

[!NOTE] Awpy requires Python >= 3.11. To update the library, just run pip install --upgrade awpy. To check your current Awpy version, run pip show awpy. If you want to see what data is available for download, run awpy get --help.

[!TIP] Don't worry if you get stuck, visit 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. You can easily find demos on HLTV, FACEIT or CS2Stats.

from awpy import Demo

# Create and parse demo
dem = Demo("g2-vs-navi.dem")
dem.parse()

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

# The dataframes are Polars dataframes
# to transform to Pandas, just do .to_pandas()
dem.ticks.to_pandas()

[!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. Additionally, you can reach out in our Discord. We're appreciate any help in identifying bugs. We use LaihoE's demoparser as a backend, so you may also check there for any open issues.

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!

[!IMPORTANT] If you use Awpy, we'd love if you could link back to our repo!

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!

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.

Awpy's team includes JanEric, adi and hojlund, who you can find in the Awpy Discord. Their work, among others, is crucial to Awpy's continued success! To contribute to Awpy, please visit CONTRIBUTING.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awpy-2.0.2.tar.gz (17.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

awpy-2.0.2-py3-none-any.whl (59.5 kB view details)

Uploaded Python 3

File details

Details for the file awpy-2.0.2.tar.gz.

File metadata

  • Download URL: awpy-2.0.2.tar.gz
  • Upload date:
  • Size: 17.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.5

File hashes

Hashes for awpy-2.0.2.tar.gz
Algorithm Hash digest
SHA256 815736c279bd9b449646d1424c82eedc6203545115c5e21db65fc33de23c2176
MD5 4ec2437312397fb954960e172db8a79c
BLAKE2b-256 4bb05c0b9938b0fed6829e494bc201eb71568ecb417856e589306d2092626009

See more details on using hashes here.

File details

Details for the file awpy-2.0.2-py3-none-any.whl.

File metadata

  • Download URL: awpy-2.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.5

File hashes

Hashes for awpy-2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c77ca9dafd647c396eac0746cf4a49413eb21a3ca51a93463e43464d0bce9a4
MD5 9bd076c6ac443b065e6d5005e227e680
BLAKE2b-256 ed11da8ee40d0952199c60e1b07ad901d4e95255ecbc8221a53d368f04026bd0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page