AwpyΒΆ

Awpy is a fast Counter-Strike 2 demo parser written in Rust with native Python bindings. It reads Source 2 demo files (.dem) and returns Polars DataFrames, giving you structured access to match data without touching the binary format yourself.

Why Awpy?ΒΆ

CS2 demo files hold a wealth of match data β€” player positions, kills, damage, round outcomes, and more β€” but the Source 2 demo format is complex and undocumented. Awpy handles the low-level parsing so you can focus on analysis.

  • ⚑ Fast. The core parser is written in Rust. A full match parses in seconds.

  • πŸ“Š Structured output. Datasets come back as Polars DataFrames, ready for filtering, grouping, joins, and plotting.

  • 🎯 Parse only what you need. Ask for one event or a handful of entity properties and Awpy skips the rest.

  • πŸ”« CS2-aware. Rounds are reconstructed from game-rules state; kills and damage carry every field; hit groups and round-end reasons are decoded to names.

  • πŸ‘οΈ Line-of-sight. VisibilityChecker answers whether two world points can see each other, using collision meshes fetched by awpy.data.

  • 🧭 Navigation meshes. NavMesh locates a point’s map area and finds shortest paths across a map’s nav graph.

  • πŸ“ˆ Plotting. awpy.plot draws game states and heatmaps on radar images (pip install 'awpy[plot]').

  • πŸ’» CLI included. pip install awpy also gives you the awpy command β€” demo inspection and map-data downloads without writing any code.

Get startedΒΆ

Install with uv add awpy or pip install awpy, then head to πŸš€ Getting started for a walkthrough. If something’s off, open a GitHub issue.

from awpy import Demo

demo = Demo("match.dem")
print(demo.header["map_name"])

rounds = demo.rounds    # round_num, winner_side, reason_name, ...
kills = demo.kills      # every player_death, all fields