Metadata-Version: 2.4
Name: boon-deadlock
Version: 0.1.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Games/Entertainment
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: polars>=1.0
Summary: Boon is a powerful Deadlock demo / replay file parser.
Keywords: deadlock,demo,parser,replay
Author-email: Peter Xenopoulos <pnxenopoulos+boon@gmail.com>
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Discord, https://discord.gg/WmjZHxWrCD
Project-URL: Documentation, https://boon.readthedocs.io
Project-URL: Homepage, https://github.com/pnxenopoulos/boon
Project-URL: Issues, https://github.com/pnxenopoulos/boon/issues
Project-URL: Repository, https://github.com/pnxenopoulos/boon

<div align="center">

# Boon

[![Discord](https://img.shields.io/discord/1466262096479129673?color=5865F2&logo=discord&logoColor=white)](https://discord.gg/WmjZHxWrCD)
[![Docs](https://readthedocs.org/projects/boon/badge/?version=latest)](https://boon.readthedocs.io)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/pnxenopoulos/boon/blob/main/LICENSE)

[![PyPI](https://img.shields.io/pypi/v/boon-deadlock.svg)](https://pypi.org/project/boon-deadlock/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/boon-deadlock.svg)](https://pypi.org/project/boon-deadlock/)
[![Python 3.11+](https://img.shields.io/badge/python-3.11+-3776AB.svg?logo=python&logoColor=white)](https://www.python.org/downloads/)

[![crates.io](https://img.shields.io/crates/v/boon-deadlock.svg)](https://crates.io/crates/boon-deadlock)
[![crates.io Downloads](https://img.shields.io/crates/d/boon-deadlock.svg)](https://crates.io/crates/boon-deadlock)
[![GitHub Release](https://img.shields.io/github/v/release/pnxenopoulos/boon?label=CLI)](https://github.com/pnxenopoulos/boon/releases)

</div>

Boon is a fast [Deadlock](https://store.steampowered.com/app/1422450/Deadlock/) demo / replay parser written in Rust with native Python bindings. It returns [Polars](https://pola.rs) DataFrames for easy analysis.

## Installation

```bash
uv add boon-deadlock

# or

pip install boon-deadlock
```

Requires Python 3.11+.

## Quick Start

```python
from boon import Demo

demo = Demo("match.dem")

# Match metadata
print(demo.match_id)         # 28309863
print(demo.map_name)         # "dl_midtown"
print(demo.total_ticks)      # 54000
print(demo.total_clock_time) # "30:00"
print(demo.winning_team_num) # 2

# Name lookups (module-level — no demo required)
from boon import hero_names, team_names, ability_names, modifier_names

print(hero_names())      # {0: "Base", 1: "Infernus", ...}
print(team_names())      # {1: "Spectator", 2: "Hidden King", 3: "Archmother"}
print(ability_names())   # {46922526: "inherent_base", ...}
print(modifier_names())  # {2059539911: "timer", ...}

# Player info
print(demo.players)
# shape: (12, 5)
# ┌─────────────┬──────────────┬─────────┬──────────┬────────────┐
# │ player_name ┆ steam_id     ┆ hero_id ┆ team_num ┆ start_lane │
# ...

# Datasets (Polars DataFrames — all lazy-loaded on first access)
player_ticks     = demo.player_ticks      # per-player state every tick
world_ticks      = demo.world_ticks       # world state every tick
kills            = demo.kills             # kill events
damage           = demo.damage            # damage events
item_purchases   = demo.item_purchases    # item shop transactions
ability_upgrades = demo.ability_upgrades  # skill point spending
abilities        = demo.abilities         # ability usage events
flex_slots       = demo.flex_slots        # flex slot unlocks
chat             = demo.chat              # chat messages
objectives       = demo.objectives        # objective health per tick
mid_boss         = demo.mid_boss          # mid boss lifecycle events
troopers         = demo.troopers          # lane trooper state per tick
neutrals         = demo.neutrals          # neutral creep state changes
stat_modifier_events = demo.stat_modifier_events  # permanent stat bonus change events
active_modifiers = demo.active_modifiers  # buff/debuff modifier events
urn              = demo.urn               # urn lifecycle and delivery events
```

## Features

- Parse Deadlock `.dem` demo files at native speed via Rust
- 17 built-in datasets covering players, combat, economy, objectives, and map state
- Access to match metadata, player info, entity state, game events, and post-match summaries
- All data returned as [Polars](https://pola.rs) DataFrames

## Documentation

Full documentation is available at [boon.readthedocs.io](https://boon.readthedocs.io).

## License

MIT — see [LICENSE](https://github.com/pnxenopoulos/boon/blob/main/LICENSE) for details.

