API Reference#

This section provides detailed documentation for all classes and functions in the Maverick library.

Core Classes#

maverick.game.Game(*[, small_blind, ...])

Texas Hold'em Poker Game.

maverick.state.GameState(*, stage, street, ...)

Represents the complete state of a Texas Hold'em game.

maverick.protocol.PlayerLike(*args, **kwargs)

Protocol defining the interface for a valid player implementation.

maverick.player.Player(*[, uid, state])

Abstract base class for a poker player.

maverick.playerstate.PlayerState(*[, seat, ...])

A player's state during a poker game.

maverick.playeraction.PlayerAction(*, ...)

Represents an action taken by a player during their turn in a game.

Card and Deck#

maverick.card.Card(*, suit, rank)

A playing card with a suit and rank.

maverick.deck.Deck(*, cards)

A standard deck of 52 playing cards.

Players#

There are two kinds of built-in players. The first kind is simple bots with very simple logic. The second kind is player archetypes that implement common behavioral patterns of poker players.

Simple Bots#

These bots have extremely simple logic and are mainly intended for testing and demonstration purposes.

maverick.players.AggressiveBot(*[, uid, state])

An aggressive bot that frequently bets and raises.

maverick.players.CallBot(*[, uid, state])

A passive bot that always calls or checks.

maverick.players.FoldBot(*[, uid, state])

A passive bot that always folds when possible.

Player Archetypes#

The following player archetypes implement common behavioral patterns observed in poker players.

maverick.players.ABCBot(*[, uid, state])

A straightforward, textbook poker bot with little deviation.

maverick.players.BullyBot(*[, uid, state])

A bot that uses stack size and intimidation to control the table.

maverick.players.FishBot(*[, uid, state])

A generally weak or inexperienced bot that makes systematic, exploitable mistakes.

maverick.players.GrinderBot(*[, uid, state])

A volume-oriented bot focused on steady expected value.

maverick.players.GTOBot(*[, uid, state])

A bot with strategy driven by game-theory optimal solutions.

maverick.players.HeroCallerBot(*[, uid, state])

A bot that calls big bets to 'keep opponents honest,' often incorrectly.

maverick.players.LooseAggressiveBot(*[, ...])

A bot that plays a wide range of hands and applies relentless pressure.

maverick.players.LoosePassiveBot(*[, uid, state])

A bot that plays too many hands and calls too often (calling station).

maverick.players.ManiacBot(*[, uid, state])

A bot that is ultra-aggressive and unpredictable.

maverick.players.ScaredMoneyBot(*[, uid, state])

A bot that plays too cautiously due to being under-rolled for the stakes.

maverick.players.SharkBot(*[, uid, state])

A bot that adapts strategy dynamically based on opponent tendencies (exploitative).

maverick.players.TightAggressiveBot(*[, ...])

A bot that is selective with starting hands, but bets and raises assertively when involved.

maverick.players.TightPassiveBot(*[, uid, state])

A bot that plays very few hands and avoids big pots without premium holdings.

maverick.players.TiltedBot(*[, uid, state])

A bot that is emotionally compromised after losses or bad beats.

maverick.players.WhaleBot(*[, uid, state])

An extremely loose bot willing to gamble large sums.

Events and Event Handling#

maverick.events.GameEvent(*, id, ts, type, ...)

Immutable game event payload.

maverick.eventbus.EventBus(*[, strict])

Simple event bus for managing event subscriptions and emissions.

Rules#

maverick.rules.PokerRules(*[, name, ...])

Full configuration for a poker game.

maverick.rules.DealingRules(*[, ...])

Rules related to seating limits and how cards are dealt.

maverick.rules.StakesRules(*, small_blind, ...)

Rules related to blinds, antes, and straddles (forced or optional preflop bets).

maverick.rules.ShowdownRules(*[, ...])

Rules related to how final hands are constructed and compared.

Hand Evaluation#

maverick.hand.Hand(*, private_cards, ...)

Private cards plus as many community cards as needed to complete the hand.

maverick.holding.Holding(*, cards)

A number of cards held by a player.

Utilities#

maverick.utils.scoring.score_hand(hand)

Classifies and scores a poker hand.

maverick.utils.holding_strength.estimate_holding_strength(...)

Estimate the holding strength as the relative linelihood of winning against n_players - 1 opponents.

Enumerations#

maverick.enums.Suit(*values)

Card suit enumeration.

maverick.enums.Rank(*values)

Card rank enumeration.

maverick.enums.Street(*values)

Betting round enumeration for Texas Hold'em.

maverick.enums.HandType(*values)

Poker hand type enumeration.

maverick.enums.PlayerStateType(*values)

Player state enumeration.

maverick.enums.GameStage(*values)

Game stage enumeration.

maverick.enums.ActionType(*values)

Player action enumeration.

maverick.enums.GameEventType(*values)

Game event enumeration.