Skip to main content

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

Usage:

Game events

from demoparser2 import DemoParser

parser = DemoParser("path_to_demo.dem")
df = parser.parse_events("player_death")

Tick data (entities)

from demoparser2 import DemoParser

wanted_props = ["m_vecX", "m_vecY"]

parser = DemoParser("path_to_demo.dem")
df = parser.parse_ticks(wanted_props)

Both functions return a Pandas Dataframe.

Example output:

             m_vecX       m_vecY   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

(steamids and names are made up in this example)

You can also filter ticks:

df = parser.parse_ticks(wanted_props, ticks=[x for x in range(29000, 30000)])

Progress:

  • Game events
  • Server info
  • Sendtables
  • Serverclasses
  • Header
  • Packet entites
  • String tables

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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

demoparser2-0.0.2-cp311-none-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.11 Windows x86-64

demoparser2-0.0.2-cp311-none-win32.whl (2.0 MB view hashes)

Uploaded CPython 3.11 Windows x86

demoparser2-0.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

demoparser2-0.0.2-cp311-cp311-macosx_10_7_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.11 macOS 10.7+ x86-64

demoparser2-0.0.2-cp310-none-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.10 Windows x86-64

demoparser2-0.0.2-cp310-none-win32.whl (2.0 MB view hashes)

Uploaded CPython 3.10 Windows x86

demoparser2-0.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

demoparser2-0.0.2-cp310-cp310-macosx_10_7_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.10 macOS 10.7+ x86-64

demoparser2-0.0.2-cp39-none-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.9 Windows x86-64

demoparser2-0.0.2-cp39-none-win32.whl (2.0 MB view hashes)

Uploaded CPython 3.9 Windows x86

demoparser2-0.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

demoparser2-0.0.2-cp39-cp39-macosx_10_7_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.9 macOS 10.7+ x86-64

demoparser2-0.0.2-cp38-none-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.8 Windows x86-64

demoparser2-0.0.2-cp38-none-win32.whl (2.0 MB view hashes)

Uploaded CPython 3.8 Windows x86

demoparser2-0.0.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

demoparser2-0.0.2-cp38-cp38-macosx_10_7_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.8 macOS 10.7+ x86-64

demoparser2-0.0.2-cp37-none-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.7 Windows x86-64

demoparser2-0.0.2-cp37-none-win32.whl (2.0 MB view hashes)

Uploaded CPython 3.7 Windows x86

demoparser2-0.0.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

demoparser2-0.0.2-cp37-cp37m-macosx_10_7_x86_64.whl (2.3 MB view hashes)

Uploaded CPython 3.7m macOS 10.7+ x86-64

Supported by

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