PokerKit is an open-source Python library designed to overcome the restrictions of existing poker game simulation and hand evaluation tools, which typically support only a handful of poker variants and lack flexibility in game state control. In contrast, PokerKit significantly expands this scope by supporting an extensive array of poker variants and it provides a flexible architecture for users to define their custom games. This paper details the design and implementation of PokerKit, including its intuitive programmatic API, multi-variant game support, and a unified hand evaluation suite across different hand types. The flexibility of PokerKit allows for applications in diverse areas, such as poker AI development, tool creation, and online poker casino implementation. PokerKit's reliability has been established through static type checking, extensive doctests, and unit tests, achieving 99% code coverage. The introduction of PokerKit represents a significant contribution to the field of computer poker, fostering future research and advanced AI development for a wide variety of poker games. The source code is available at https://github.com/uoftcprg/pokerkit
翻译:PokerKit是一个开源Python库,旨在突破现有扑克游戏仿真与手牌评估工具的限制——这些工具通常仅支持少数扑克变体且缺乏游戏状态控制的灵活性。相比之下,PokerKit通过支持大量扑克变体显著扩展了应用范围,并提供了灵活架构供用户自定义游戏。本文详细阐述了PokerKit的设计与实现,包括其直观的程序化API、多变体游戏支持以及跨不同手牌类型的统一手牌评估套件。PokerKit的灵活性使其可广泛适用于扑克人工智能开发、工具创建及在线扑克赌场实现等场景。通过静态类型检查、详尽的文档测试与单元测试,PokerKit已实现99%的代码覆盖率,其可靠性得到充分验证。PokerKit的推出是对计算机扑克领域的重大贡献,将推动未来面向多种扑克游戏的研究与高级人工智能开发。源代码详见https://github.com/uoftcprg/pokerkit