Bluff is a pythonic poker framework.
Currently, bluff covers the following poker variants:
- Texas Hold'em
- Chinese Poker
Use the package manager pip to install Bluff.
pip install bluff
import bluff
# Hands can be created by passing Card instances as arguments.
hand1 = bluff.Hand(
bluff.Card("5d"),
bluff.Card("4s"),
bluff.Card("5s"),
bluff.Card("4c"),
bluff.Card("5h"),
)
hand1.name
>>> "full_house"
import bluff
# Hands can also be created by passing their string representations.
hand1 = bluff.Hand("5d", "4s", "5s", "4c", "5h")
# Concatenated strings are also accepted.
hand2 = bluff.Hand("Jh", "Td", "Js", "5s", "8d")
hand1.value > hand2.value
>>> True
import bluff
player = bluff.Player(name="Chris Moneymaker", chips=10000)
deck = bluff.Deck()
card = deck.draw()
player.hand.add(card)
from bluff.holdem import equity
equity.equity(("QQ", "AKo"), times=10000)
from bluff.holdem import equity
# Ranges descriptions.
equity.eval_ranges("JTs", ("KQs ATo 99", "AKs QQ"), times=10000)
# Ranges percentages.
equity.eval_ranges("JTs", (10, 30), times=10000)
For more information see the documentation.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- Matheus Couto - Linkedin
This project is licensed under the MIT License.