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.
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.
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")
| Module | What it does |
|---|---|
cards | deck, 7-card hand scoring, best_hand |
equity | Monte Carlo equity, incl. against weighted ranges |
ranges | the 169 hand classes, range parsing, preflop matrices |
aof | all-in-or-fold CFR solvers |
multiway | multiway postflop CFR (needs numpy) |
limitations; read them before trusting a number.PF_GTO_DATA_DIR elsewhere to swap them.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.