Metadata-Version: 2.4
Name: batru
Version: 0.2.1
Summary: Official Python client for batru.gg — real, calibrated Dota 2, Deadlock & Marvel Rivals win-rate predictions, tier lists, counters and draft picks.
Project-URL: Homepage, https://batru.gg
Project-URL: Repository, https://github.com/batrugg/batru
Author-email: Batru <noreply@batru.gg>
License: MIT
License-File: LICENSE
Keywords: api-client,batru,deadlock,dota2,esports,marvel-rivals,sdk,win-prediction
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Games/Entertainment
Requires-Python: >=3.10
Requires-Dist: httpx>=0.24.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == 'dev'
Description-Content-Type: text/markdown

# batru

Official Python client for [batru.gg](https://batru.gg) — real, **calibrated**
win-rate predictions and pick recommendations across **three games**
(**Dota 2**, **Deadlock**, **Marvel Rivals**), served by production models
trained on real matches.

> **Early preview (alpha).** The surface is intentionally tiny and may change.
> This package is the home of the official batru.gg SDK; the
> [MCP server](https://github.com/batrugg/batru-mcp) for LLMs lives separately.

## Install

```sh
pip install batru
```

## Use

```python
import batru

# Calibrated win probability for a (partial) draft — hero shortNames:
batru.winrate(radiant=["antimage", "axe"], dire=["lina", "tinker"])
# {'radiant_win_rate': 52.31, 'dire_win_rate': 47.69}

# Best next picks for our (Radiant) team:
batru.recommend(radiant=["antimage"], dire=["lina", "tinker"])

# Hero roster, to map display names to the shortNames used above:
[h["shortName"] for h in batru.heroes()][:3]
```

### Deadlock & Marvel Rivals

Deadlock and Marvel Rivals use full 6v6 drafts keyed by **integer hero ids**
(map names to ids with the `*_heroes()` rosters):

```python
import batru

# Rosters: [{"id": int, "name": str}, ...]
batru.deadlock_heroes()
batru.marvel_heroes()

# Meta content (dicts, returned as-is):
batru.deadlock_tier_list()      # or marvel_tier_list()
batru.deadlock_counters()       # worst matchups per hero
batru.deadlock_synergy()        # best teammates per hero

# Calibrated comp-only draft win probability (6 ids per team) — this models
# the hero composition, not player skill:
batru.deadlock_predict_draft([1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12])
# {'win_prob_team0': 0.53}
batru.marvel_predict_draft([1, 2, 3, 4, 5, 6], [7, 8, 9, 10, 11, 12])
```

Probabilities are **calibrated**: a reported 60% corresponds to an empirically
observed ~60% win rate on holdout data — see the
[methodology](https://batru.gg/dota2/methodology).

Read-only, no key required. Please keep request volume reasonable.

Analysis only, no betting.

## License

MIT © Batru (batru.gg)
