{"id":27688,"library":"demoparser2","title":"demoparser2","description":"A Python library for parsing CS2 (Counter-Strike 2) demo files. It provides fast, low-level access to demo tick data including events, player positions, and game state. Current version: 0.41.2. Weekly releases on PyPI.","status":"active","version":"0.41.2","language":"python","source_language":"en","source_url":"https://github.com/LordOfPolls/demoparser2","tags":["cs2","demo parser","counter-strike 2"],"install":[{"cmd":"pip install demoparser2","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for array operations in event data","package":"numpy","optional":false}],"imports":[{"note":"The library is named demoparser2, not demoparser.","wrong":"from demoparser import DemoParser","symbol":"DemoParser","correct":"from demoparser2 import DemoParser"}],"quickstart":{"code":"from demoparser2 import DemoParser\n\nparser = DemoParser('path/to/demo.dem')\nevents = parser.parse_events(events=['player_death', 'round_start'])\nfor event in events[:5]:\n    print(event)\n\ntick_data = parser.parse_ticks(ticks=[0, 1000, 5000])\nprint(tick_data)","lang":"python","description":"Parse events and tick data from a CS2 demo file."},"warnings":[{"fix":"Update code to match new API. Review changelog on GitHub for migration details.","message":"API changes between versions 0.2x and 0.4x: many method signatures changed. For example, 'parse_events' now requires 'events' as a keyword argument with a list of event names, not just a string. Also, 'parse_ticks' no longer accepts 'ticks_to_parse' parameter; use 'ticks' instead.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Replace parser.parse_demo() with parser.parse_events(...) and parser.parse_ticks(...).","message":"The method 'parse_demo' has been removed in version 0.4.0. Use 'parse_events' and 'parse_ticks' instead.","severity":"deprecated","affected_versions":">=0.4.0"},{"fix":"Use the 'events' and 'ticks' parameters to limit data; parse only what you need.","message":"Parsing all events or ticks without filtering can be extremely memory-intensive, especially for long demos. Always specify a subset of events or ticks.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Verify the file path. Use an absolute path or ensure the relative path is correct.","cause":"The demo file path is incorrect or the file does not exist.","error":"FileNotFoundError: [Errno 2] No such file or directory: 'path/to/demo.dem'"},{"fix":"Use correct import: from demoparser2 import DemoParser","cause":"Incorrect import statement (e.g., 'import demoparser2' instead of 'from demoparser2 import DemoParser').","error":"AttributeError: module 'demoparser2' has no attribute 'DemoParser'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}