No project description provided
Project description
Demo parser for Counter-Strike 2
Work in progress so expect some bugs here and there!
Install
pip install demoparser2
Documentation
This will have to do for now 😂
Utility functions
parser = DemoParser("path_to_demo.dem")
# returns list like: ["player_death", "weapon_fire"...]
event_name_list = parser.list_game_events()
df = parser.parse_grenades()
df = parser.parse_item_drops()
df = parser.parse_skins()
df = parser.parse_player_info()
dict_output = parser.parse_convars()
All of these take no arguments and return the same shape data. Probably easiest to understand by just trying these out.
Game events
from demoparser2 import DemoParser
parser = DemoParser("path_to_demo.dem")
df = parser.parse_events("player_death")
You can find out what events your demo had with:
event_names = parser.list_game_events()
This can be helpful: https://wiki.alliedmods.net/Counter-Strike:_Global_Offensive_Events
List is for CSGO events seem similar to CS2.
Tick data (entities)
from demoparser2 import DemoParser
wanted_fields = ["X", "Y"]
parser = DemoParser("path_to_demo.dem")
df = parser.parse_ticks(wanted_fields)
Example output of parse_ticks():
X Y tick steamid name
0 649.795044 633.648438 0 76512345678912345 person1
1 526.207642 794.186157 0 76512345678912345 person2
2 997.494324 583.692871 0 76512345678912345 person3
3 958.421570 498.485657 0 76512345678912345 person4
4 624.525696 556.522217 0 76512345678912345 person5
... ... ... ... ... ...
913215 924.593140 308.131622 30452 76512345678912345 person6
913216 598.564514 794.186157 30452 76512345678912345 person7
913217 329.393677 323.219360 30452 76512345678912345 person8
913218 526.207642 81.611084 30452 76512345678912345 person9
913219 36.691650 308.887451 30452 76512345678912345 person10
List of values to try for parse_ticks()
"X"
"Y"
"Z"
"is_freeze_period"
"is_warmup_period"
"warmup_period_end"
"warmup_period_start"
"is_terrorist_timeout"
"is_ct_timeout"
"terrorist_timeout_remaining"
"ct_timeout_remaining"
"num_terrorist_timeouts"
"num_ct_timeouts"
"is_technical_timeout"
"is_waiting_for_resume"
"match_start_time"
"round_start_time"
"restart_round_time"
"is_game_restart"
"game_start_time"
"time_until_next_phase_start"
"game_phase"
"total_rounds_played"
"rounds_played_this_phase"
"hostages_remaining"
"any_hostages_reached"
"has_bombites"
"has_rescue_zone"
"has_buy_zone"
"is_matchmaking"
"match_making_mode"
"is_valve_dedicated_server"
"gungame_prog_weap_ct"
"gungame_prog_weap_t"
"spectator_slot_count"
"is_match_started"
"n_best_of_maps"
"is_bomb_dropped"
"is_bomb_planed"
"round_win_status"
"round_win_reason"
"terrorist_cant_buy"
"ct_cant_buy"
"num_player_alive_ct"
"num_player_alive_t"
"ct_losing_streak"
"t_losing_streak"
"survival_start_time"
"round_in_progress"
"is_auto_muted"
"crosshair_code"
"pending_team_num"
"player_color"
"ever_played_on_team"
"clan_name"
"is_coach_team"
"comp_rank"
"comp_wins"
"comp_rank_type"
"is_controlling_bot"
"has_controlled_bot_this_round"
"can_control_bot"
"is_alive"
"health"
"armor"
"has_defuser"
"has_helmet"
"spawn_time"
"death_time"
"score"
"game_time"
"is_connected"
"player_name"
"player_steamid"
"fov"
"balance"
"start_balance"
"total_cash_spent"
"cash_spent_this_round"
"music_kit_id"
"leader_honors"
"teacher_honors"
"friendly_honors"
"kills_this_round"
"deaths_this_round"
"assists_this_round"
"alive_time_this_round"
"headshot_kills_this_round"
"damage_this_round"
"objective_this_round"
"utility_damage_this_round"
"enemies_flashed_this_round"
"equipment_value_this_round"
"money_saved_this_round"
"kill_reward_this_round"
"cash_earned_this_round"
"kills_total"
"deaths_total"
"assists_total"
"alive_time_total"
"headshot_kills_total"
"ace_rounds_total"
"4k_rounds_total"
"3k_rounds_total"
"damage_total"
"objective_total"
"utility_damage_total"
"enemies_flashed_total"
"equipment_value_total"
"money_saved_total"
"kill_reward_total"
"cash_earned_total"
"ping"
"team_surrendered"
"team_rounds_total"
"team_name"
"team_score_overtime"
"team_match_stat"
"team_num_map_victories"
"team_score_first_half"
"team_score_second_half"
"team_clan_name
Acknowledgements
Without Dotabuff's dota 2 parser "manta" this would not have been possible. Check it out: https://github.com/dotabuff/manta
The dota 2 demo format is very similar to CS2 demo format with only a few minor changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for demoparser2-0.0.6-cp311-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cba023d1707796de708a604c2a3fca38a5384909018b3ccf88ba8b919d889532 |
|
MD5 | f68c1edd56de062286d76c6e82f1c317 |
|
BLAKE2b-256 | 67bf01cf7457175c79fb125cd186f41558d367e87dd2e6107172ee48851feec8 |
Hashes for demoparser2-0.0.6-cp311-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3686400e663dbb6ad262a10b18a755b48e0f52a9e218787d222ca02436afe6d |
|
MD5 | 5142a01a649f73fc407b0d7c75d057af |
|
BLAKE2b-256 | 31f7c919ae702577a27190648c496a06058b783c99a78d0c1270f42b2b6fe152 |
Hashes for demoparser2-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73cfcad3564e8a696d7f8c90ac349b7985907b31efc9f8133e3d43b8e4bdeece |
|
MD5 | 0c0ecbc6ccca5537effdac22651d9ee9 |
|
BLAKE2b-256 | 3c09711cf4d7448cc88acba15f52b2f408712c33a0f8eb064f0d5024e1fe1e6a |
Hashes for demoparser2-0.0.6-cp311-cp311-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36feec774b778eb50706ee62e916465bb339f7cd64f39bec1ba543065edbfc34 |
|
MD5 | c7c8f7ea025ae19791322d78eea44ae1 |
|
BLAKE2b-256 | 0d0b8a2077c3619804e7ee94b650aff0e69467f603485c66fa95f6434fa92b72 |
Hashes for demoparser2-0.0.6-cp310-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 600b126e4f86303271e6c23666addef906313c7cf902ff6f43a19bdbe4409a31 |
|
MD5 | a5ffab1f308b2e3a11519ab64ef58bd6 |
|
BLAKE2b-256 | 7b5dae4241e417053682f80620c2c0afa253545213aa82686ffc10c72bcbdd23 |
Hashes for demoparser2-0.0.6-cp310-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20dd7a5d38daa9cfd5ff0f54064715f37c160463441bb62280206569f6beb9f5 |
|
MD5 | 8e32ef444fbfb6f665d8bdd3f45e3bb2 |
|
BLAKE2b-256 | f1c4a04397bdce7d5298be29919acea9293f2f0fe418abccfcff6dce82b7c52c |
Hashes for demoparser2-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d11d4b65f38c050defb1388532b42defc79c01d0fbbc27ca5ea9533206be828 |
|
MD5 | 9e0faf79428a8470eb62dbfa4e81ab91 |
|
BLAKE2b-256 | 799e780f98b20562296830b8f04d6985aa2eb32909cbd47018baba612b9a50d2 |
Hashes for demoparser2-0.0.6-cp310-cp310-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94a053101d1753b1e523248c8d2205048a4c7a5755d2d25d5c03affe5359d717 |
|
MD5 | 400300c4a014fcd5ee2f33bae305b40d |
|
BLAKE2b-256 | 8fe51d277b7804c37b6c1d3f5c56c0ed388e52daaed5ed2ef13c37cbe6f9745b |
Hashes for demoparser2-0.0.6-cp39-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fa4ec0e21b9c7c01d3a8f548593942b3d0aeae25fe5507c3815702d21d6a798 |
|
MD5 | dab829bdce2faa76b3a2241e7e93f1ff |
|
BLAKE2b-256 | 1d41f046c5a30d332ea90147f4041a31303d713990a3119e8e98a35484d4595c |
Hashes for demoparser2-0.0.6-cp39-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25450df00baad86bc8ab7e24fe86538bdc25a3c3a8868822d3272fe445faee84 |
|
MD5 | d41ba7cf8bda7c3f186694cbfcd102e7 |
|
BLAKE2b-256 | 93b49055dcd7ea2d163e830f64adbc209c047655a56e4382aff689e50a13c660 |
Hashes for demoparser2-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f8e9baca91a6e3e28a17af1ca3209b255517f9ce1442125474b39a03d8779ba |
|
MD5 | bc634b62b77f029d0cb711de2aa092d5 |
|
BLAKE2b-256 | 439f4411dd279fd4d5accc1b391268261de47e84c8dea81f216e9162cdf4f957 |
Hashes for demoparser2-0.0.6-cp39-cp39-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bef0a3c06d64df2ad9835a53cefda4a495767cf08a2f60fc70bd625847f324f |
|
MD5 | 62e7354c96f82da8eacaf0848c463135 |
|
BLAKE2b-256 | a534ecccf6a3cc7e966e290db77283f9d7729ba7b27ae04498c2be238bb556c3 |
Hashes for demoparser2-0.0.6-cp38-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad5062bf16325258d7ba46d97f26c5b7fce9e88d7680331b9a304db817601a64 |
|
MD5 | 80bddc5f534a950586d15d19736f3cfe |
|
BLAKE2b-256 | 1501052079eca85a11557975a4835d6d34fc87cc623e056a6cb75efd225a6379 |
Hashes for demoparser2-0.0.6-cp38-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c7e97036e7bebe67cf76368c6c64f543c59214b828bca29b394ca19ba2c766d |
|
MD5 | 4d9869db84c652064a091e5c5151aa57 |
|
BLAKE2b-256 | 3c7b791d6c3cf15437ba4070a3dd42dae1dc5a271f14140e099ebbb6a155c086 |
Hashes for demoparser2-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e024d581acd49f26c3e67e3c772b7bf02def5b8226ed0558cb77f011d89326d |
|
MD5 | a3595b2df4f708d6a3163e235e5f8181 |
|
BLAKE2b-256 | 83fccdde32a02e98096526ffe8d9a7857b9aeefecba61eeee4274278fd59d82d |
Hashes for demoparser2-0.0.6-cp38-cp38-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | adc9a80ad6b988d9fb1b7b4fd790f1ba5621283945ad76189155ac79683d18da |
|
MD5 | aae151c3a21644b230f9108c3738f228 |
|
BLAKE2b-256 | 962af246d980e53a376c14d9405b204e7b045f1c03843843f20f030b3be1f9d7 |
Hashes for demoparser2-0.0.6-cp37-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 51bc7828fe81d01ebecf8d6ee3233b8c4cc0abf76a8539483ff1dad83a0d7382 |
|
MD5 | 42d0d385b69d2644dfe648e80e19817a |
|
BLAKE2b-256 | f66edd9790583665a2b25e4f5d62ed728c79744f7804f0aee1988bcb2d76dfc0 |
Hashes for demoparser2-0.0.6-cp37-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9242c0a7796aba3e726043601398673af838f484ac3f2092506d599b47ed3b9e |
|
MD5 | 4bb07c04aefe935e9a90f127ebde8c24 |
|
BLAKE2b-256 | 215b8ba47a004027bb3e8291c52eb9657bc1b89a454dcad895cfca1e258a122f |
Hashes for demoparser2-0.0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbc654cc36ed9e1f3b9a840dc67d9891b4cd86c1c6e40adecd45df359a3e5850 |
|
MD5 | 764358ea247bcdab7f642b671d827ae1 |
|
BLAKE2b-256 | 854ee97bbeef18b85c72aaa6060f46ad3cb6a3e8a0feda60d81ae4552c7c0a4b |
Hashes for demoparser2-0.0.6-cp37-cp37m-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09e066f6d7f0d8a7df3c9d77948226afd06bb20a59925ef4598daab6fc3d64ec |
|
MD5 | 6084e180812291732e05d33b4c70c767 |
|
BLAKE2b-256 | 9a7ca43d98b0f7a0cd2370370e6f3a1678a9c584451f69daf96fffb68d45d7c2 |