pokersolver

Deterministic poker math as a library.

Card evaluation, Monte Carlo equity against weighted ranges, the 169-hand grid, precomputed preflop matrices, and CFR solvers for all-in-or-fold and multiway postflop spots.

The library has no notion of “a player to act” and no game-state type of its own. It takes primitives — cards, stacks in big blinds, positions as strings — and returns numbers. Wiring it to an engine is the caller’s job.

Install

git clone https://github.com/frla18cz/poker-solver
cd poker-solver
pip install -e '.[dev]'

Requires Python 3.14+. The core is stdlib-only; numpy is needed only for the multiway CFR.

Use

from pokersolver.cards import best_hand
from pokersolver.equity import equity_vs_range
from pokersolver.ranges.hand_grid import hand_class
from pokersolver.ranges.gto import default_multi_solutions

hand_class("As", "Kh")                  # 'AKo'
solutions = default_multi_solutions()   # precomputed preflop matrices
spot = solutions.for_stack(100).for_open(2.5).get_or_none("btn_vs_co")

What is in it

ModuleWhat it does
cardsdeck, 7-card hand scoring, best_hand
equityMonte Carlo equity, incl. against weighted ranges
rangesthe 169 hand classes, range parsing, preflop matrices
aofall-in-or-fold CFR solvers
multiwaymultiway postflop CFR (needs numpy)

What it does not do

A table for it

Because the library cannot deal a hand or take a turn, pokerarena is the project that does — a poker table you sit at in a browser, with friends or bots. Its solver seat is this library wired to an engine.