Skip to main content

A Python library for simulating poker games with custom player strategies

Project description

Maverick banner

Documentation Status Code Coverage Code Quality Code Style License

Documentation

BuyMeACoffee

A Python library for simulating poker games with custom player strategies.

Poker is a great sandbox for decision-making systems: hidden information, imperfect opponents, probabilistic outcomes, and lots of room for experimentation.

Maverick is a Python library for simulating poker games with custom player strategies. It gives you a complete poker game loop (dealing, betting rounds, showdown, pot distribution) plus a clean player interface so you can swap strategies in and out.

Highlights

Maverick is designed for building and testing strategies:

  • Composable API: build your own players by implementing a single method.
  • State-machine engine: clear phases and transitions, easier to reason about.
  • Event stream: observe what happens (for logging, analytics, replay, debugging).
  • Hand evaluation utilities: score hands and compare outcomes.

If you’ve ever wanted to:

  • benchmark bots against each other,
  • run repeatable simulations,
  • prototype an agent that makes betting decisions,

…Maverick is meant to make that workflow straightforward.

Installation

You can install Maverick from PyPI

pip install maverick

Your first game (minimal example)

Here’s an end-to-end example using built-in bots:

from maverick import Game, PlayerLike, PlayerState
from maverick.players import FoldBot, CallBot, AggressiveBot

# Create a game with blinds and a stop condition
game = Game(small_blind=10, big_blind=20, max_hands=10)

# Create players
players: list[PlayerLike] = [
    CallBot(name="CallBot", state=PlayerState(stack=1000)),
    AggressiveBot(name="AggroBot", state=PlayerState(stack=1000)),
    FoldBot(name="FoldBot", state=PlayerState(stack=1000)),
]

for player in players:
    game.add_player(player)

game.start()

# Inspect results
for player in players:
    print(f"{player.name} - Stack: {player.state.stack}")

(See the documentation for more examples and APIs.)

Documentation

The project has extensive documentation hosted on ReadTheDocs. Most library information is documented there, with only the essentials kept here.

Changes and Versioning

The changelog is maintained in CHANGELOG.md. The project adheres to semantic versioning.

Contributing

Contributions are currently expected in any the following ways:

  • finding bugs If you run into trouble when using the library and you think it is a bug, feel free to raise an issue.
  • feedback All kinds of ideas are welcome. For instance if you feel like something is still shady (after reading the user guide), we want to know. Be gentle though, the development of the library is financially not supported yet.
  • feature requests Tell us what you think is missing (with realistic expectations).
  • examples If you've done something with the library and you think that it would make for a good example, get in touch with the developers and we will happily inlude it in the documention.
  • funding Use one of the supported funding channels. Any amount you can afford is appreciated.
  • sharing is caring If you like the library, share it with your friends or colleagues so they can like it too.

In all cases, read the contributing guidelines before you do anything.

License

This package is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

maverick-0.2.3.tar.gz (37.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

maverick-0.2.3-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file maverick-0.2.3.tar.gz.

File metadata

  • Download URL: maverick-0.2.3.tar.gz
  • Upload date:
  • Size: 37.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for maverick-0.2.3.tar.gz
Algorithm Hash digest
SHA256 b722174f928c579f93d8703b01e99076510b85e724f5e3a1ce5c0d7d1ca92a28
MD5 054f4bcc757ae369b80658c11b6fdb2b
BLAKE2b-256 0842a1c7747de7b8f54a5dfaab6573235820821369539ee40dcb67f62766e158

See more details on using hashes here.

File details

Details for the file maverick-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: maverick-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for maverick-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4f753eb046409612acaac6aa1e00e2656552c9cf2972d40340f88f3085078d
MD5 65a075f1f84349377d7a0e1301f004ad
BLAKE2b-256 2611f563d54f9fc9f2e1b1337743fdfef5a3ea3971d2c16390917ce29795209d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page