← all repositories
ishikota/PyPokerEngine

A Python poker engine that lets your AI bluff (badly) in minutes

PyPokerEngine handles the card-dealing and betting logic so you can focus on making your bot fold at the worst possible time.

713 stars Python Domain Apps
PyPokerEngine
Velocity · 7d
+0.2
★ / day
Trend
steady
star history

What it does PyPokerEngine runs Texas Hold’em games in Python and exposes a clean callback interface for AI players. You subclass BasePokerPlayer, implement declare_action, and the engine handles deck shuffling, betting rounds, pot management, and hand evaluation. It also includes an Emulator class for reinforcement learning that lets you simulate forward from any game state.

The interesting bit The RL-focused Emulator is the real differentiator. Instead of just playing games, you can fork the state, run hypothetical hands to completion, and use those outcomes to train your model — essentially giving your bot a pocket universe to practice its bad beats in.

Key highlights

  • Python 2.7 and 3.5 support (the README’s era is showing)
  • setup_config + start_poker gets a multi-AI game running in ~5 lines
  • Emulator.apply_action, run_until_round_finish, and run_until_game_finish for state-tree search
  • Companion project PyPokerGUI for browser-based visualization
  • Documented callback formats for what your bot receives at each game stage

Caveats

  • Last meaningful activity appears to be Travis CI and Python 2.7-era; don’t expect active maintenance
  • The RL example code in the README has a bug (updated_state is used before being defined in the declare_action snippet)

Verdict Grab this if you want a lightweight, hackable poker environment for RL experiments or bot tournaments. Skip it if you need production-grade multiplayer networking or a modern, maintained codebase — this is a research sandbox, not a casino backend.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.