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.
VisibilityCheckeranswers whether two world points can see each other, using collision meshes fetched byawpy.data.π§ Navigation meshes.
NavMeshlocates a pointβs map area and finds shortest paths across a mapβs nav graph.π Plotting.
awpy.plotdraws game states and heatmaps on radar images (pip install 'awpy[plot]').π» CLI included.
pip install awpyalso gives you theawpycommand β 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
Useful linksΒΆ
Counter-Strike 2 β official home page
Polars β the DataFrame library Awpy returns data in
Boon β sister project: a Deadlock demo parser with the same Rust-core, Polars-out design
deadlock.nyc β sister project: a fully client-side Deadlock demo viewer that runs in your browser