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.

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_pokergets a multi-AI game running in ~5 linesEmulator.apply_action,run_until_round_finish, andrun_until_game_finishfor 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_stateis used before being defined in thedeclare_actionsnippet)
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.