PokerFace is a Python package for various poker tools.

Overview

PokerFace

PokerFace is a Python package for various poker tools.

The following features are present in PokerFace...

  • Types for cards and their components and related helper functions
    • Rank
    • Suit
    • Ranks
    • Card
    • Hole Card
  • Various types of poker decks
    • Standard Deck
    • Short Deck
  • Poker hand evaluations
    • Standard Evaluator
    • Greek Evaluator
    • Omaha Evaluator
    • Short-Deck Evaluator
    • Deuce-to-Seven Lowball Evaluator
    • Ace-to-Five Lowball Evaluator
    • Badugi Evaluator
  • Poker game variants
    • Texas Hold'em
      • Fixed-Limit Texas Hold'em
      • No-Limit Texas Hold'em
    • Omaha Hold'em
      • Pot-Limit Omaha Hold'em
    • 5-Card Omaha Hold'em
      • Fixed-Limit 5-Card Omaha Hold'em
      • Pot-Limit 5-Card Omaha Hold'em
    • 6-Card Omaha Hold'em
      • Pot-Limit 6-Card Omaha Hold'em
    • Greek Hold'em
      • Fixed-Limit Greek Hold'em
      • Pot-Limit Greek Hold'em
      • No-Limit Greek Hold'em
    • Short-Deck Hold'em
      • No-Limit Short-Deck Hold'em
    • 5-Card Draw
      • Fixed-Limit 5-Card Draw
      • Pot-Limit 5-Card Draw
      • No-Limit 5-Card Draw
    • Badugi
      • Fixed-Limit Badugi
    • 2-to-7 Single Draw Lowball
      • No-Limit 2-to-7 Single Draw Lowball
    • 2-to-7 Triple Draw Lowball
      • Fixed-Limit 2-to-7 Triple Draw Lowball
      • Pot-Limit 2-to-7 Triple Draw Lowball
    • Kuhn Poker
      • Fixed-Limit Kuhn Poker

The full documentation is available at Read the Docs.

License

GNU GPLv3

You might also like...
[DEPRECATED] YUM package manager

⛔ This project is deprecated. Please use DNF, the successor of YUM. YUM Yum is an automatic updater and installer for rpm-based systems. Included prog

A Poetry plugin for dynamically extracting the package version.

Poetry Version Plugin A Poetry plugin for dynamically extracting the package version. It can read the version from a file __init__.py with: # __init__

Easy to use, fast, git sourced based, C/C++ package manager.

Yet Another C/C++ Package Manager Easy to use, fast, git sourced based, C/C++ package manager. Features No need to install a program, just include the

The delightful package manager for AppImages

⚡️ Zap The delightful package manager for AppImages Report bug · Request feature Looking for the older Zap v1 (Python) implementation? Head over to v1

Dotpkg - Package manager for your dotfiles

Dotpkg A package manager for your dotfiles. Usage First make sure to have Python

Python dependency management and packaging made easy.
Python dependency management and packaging made easy.

Poetry: Dependency Management for Python Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right sta

A PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/

This is a PyPI mirror client according to PEP 381 + PEP 503 http://www.python.org/dev/peps/pep-0381/. bandersnatch =4.0 supports Linux, MacOSX + Wind

Python PyPi staging server and packaging, testing, release tool

devpi: PyPI server and packaging/testing/release tool This repository contains three packages comprising the core devpi system on the server and clien

Python dependency management and packaging made easy.
Python dependency management and packaging made easy.

Poetry: Dependency Management for Python Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right sta

Comments
  • game.actor.showdown() throws IndexError for 2nd player at the end of a hand

    game.actor.showdown() throws IndexError for 2nd player at the end of a hand

    from pokerface import *
    from random import random
    
    evaluator = StandardEvaluator()
    deck = StandardDeck()
    stakes = (0,(1,2))
    stacks = [100,100]
    
    def random_action(p):
        if p.can_fold() and p.check_call_amount > 0 and random()<0.25:
            p.fold()
            return
        r = random()
        if r < 0.33:
            p.check_call()
        elif r<0.6:
            if p.can_bet_raise():
                p.bet_raise(max(p.bet_raise_min_amount, p.stack/5))
        elif r<0.75:
            if p.can_bet_raise():
                p.bet_raise(max(p.bet_raise_min_amount, p.stack/3))
        elif r<0.9:
            if p.can_bet_raise():
                p.bet_raise(max(p.bet_raise_min_amount, p.stack/5))
        elif r<0.9:
            if p.can_bet_raise():
                p.bet_raise(p.stack)
    
    def hand():
        deck = StandardDeck()
        game = NoLimitTexasHoldEm(Stakes(0, (1, 2)), stacks)
        game.nature.deal_hole()
        game.nature.deal_hole()
        while game.is_terminal() == False and game.actor != game.nature:
            random_action(game.actor)
    
        if game.is_terminal() == False:
            game.nature.deal_board()
            if game.actor != game.nature:
                game.actor.check_call()
                game.actor.check_call()
            game.nature.deal_board()
            if game.actor != game.nature:
                game.actor.check_call()
                game.actor.check_call()
            game.nature.deal_board()
            if game.actor != game.nature and game.is_terminal() == False:
                game.actor.check_call()
                game.actor.check_call()
            print(game.players, '____')
            for p in game.players:
                 if game.is_terminal() == False:
                    print(game.players)
                    print(game.actor)
                    print(game.actor.can_showdown(), game.actor.is_showdown_necessary())
                    game.actor.showdown()
        # print(dir(game))
        # print(dir(game.nature))
        print(game.players, 'end')
        stacks.clear()
        stacks.append(game.players[1].stack)
        stacks.append(game.players[0].stack)
        return 
    
    
    while 0 not in stacks:
        hand()
    

    results in

    SequenceView([PokerPlayer(0, 101, ????), PokerPlayer(0, 99)]) end
    SequenceView([PokerPlayer(0, 79.0, ????), PokerPlayer(0, 81.0, ????)]) ____
    SequenceView([PokerPlayer(0, 79.0, ????), PokerPlayer(0, 81.0, ????)])
    PokerPlayer(0, 79.0, ????)
    True True
    SequenceView([PokerPlayer(0, 79.0, 2cJs), PokerPlayer(0, 81.0, ????)])
    PokerPlayer(0, 81.0, ????)
    True True
    SequenceView([PokerPlayer(0, 79.0, 2cJs), PokerPlayer(0, 121.0, QhAd)]) end
    Traceback (most recent call last):
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/game.py", line 270, in _update
        while self.stages[index]._is_done():
    IndexError: tuple index out of range
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "create_data.py", line 67, in <module>
        hand()
      File "create_data.py", line 35, in hand
        random_action(game.actor)
      File "create_data.py", line 11, in random_action
        p.fold()
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/game.py", line 708, in fold
        self._get_fold_action().act()
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/_actions.py", line 16, in act
        self.game._update()
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/game.py", line 275, in _update
        self._distribute()
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/game.py", line 283, in _distribute
        for side_pot in self._side_pots:
      File "/home/tenoke/.local/lib/python3.8/site-packages/pokerface/game.py", line 187, in _side_pots
        cur = players[-1]._put
    IndexError: list index out of range
    

    despite needing to showdown to finish the hand

    opened by Tenoke 2
Releases(v1.0.1)
Owner
Juho Kim
University of Toronto Engineering Science
Juho Kim
pip-run - dynamic dependency loader for Python

pip-run provides on-demand temporary package installation for a single interpreter run. It replaces this series of commands (or their Windows equivale

Jason R. Coombs 79 Dec 14, 2022
If you have stars in your Pipfile and you don't want them, this project is for you!

unstar-pipfile If you have stars in your Pipfile, this project is for you! unstar-pipfile is a tool to scan Pipfile.lock and replace any stars in Pipf

2 Jul 26, 2022
Workon - A simple project manager for conda, windows 10 and vscode

WORK ON A simple project manager for conda, windows 10 and vscode Installation p

Jesus Alan Hernandez Galvan 1 Jan 16, 2022
Install and Run Python Applications in Isolated Environments

pipx — Install and Run Python Applications in Isolated Environments Documentation: https://pipxproject.github.io/pipx/ Source Code: https://github.com

5.8k Dec 31, 2022
For when Poetry just doesn't work.

Ballad For when Poetry just doesn't work. Have you tried setting up Poetry, but something doesn't work? Maybe you're... Trying to implement Github Act

BD103 4 Dec 06, 2021
Dotpkg - Package manager for your dotfiles

Dotpkg A package manager for your dotfiles. Usage First make sure to have Python

FW 4 Mar 18, 2022
Python PyPi staging server and packaging, testing, release tool

devpi: PyPI server and packaging/testing/release tool This repository contains three packages comprising the core devpi system on the server and clien

629 Jan 01, 2023
Python dependency management and packaging made easy.

Poetry: Dependency Management for Python Poetry helps you declare, manage and install dependencies of Python projects, ensuring you have the right sta

Poetry 23.2k Jan 05, 2023
Example for how to package a Python library based on Cython.

Cython sample module This project is an example of a module that can be built using Cython. It is an upgrade from a similar model developed by Arin Kh

Juan José García Ripoll 4 Aug 28, 2022
Simple Library Management made with Python

Installation pip install mysql-connector-python NOTE: You must make a database (library) & and table (books, student) to hold all data. Languange and

SonLyte 10 Oct 21, 2021
pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.

pipreqs - Generate requirements.txt file for any project based on imports Installation pip install pipreqs Usage Usage: pipreqs [options] path

Vadim Kravcenko 4.8k Dec 31, 2022
The Python package installer

pip - The Python Package Installer pip is the package installer for Python. You can use pip to install packages from the Python Package Index and othe

Python Packaging Authority 8.4k Dec 30, 2022
Conan - The open-source C/C++ package manager

Conan Decentralized, open-source (MIT), C/C++ package manager. Homepage: https://conan.io/ Github: https://github.com/conan-io/conan Docs: https://doc

Conan.io 6.5k Jan 05, 2023
Package manager based on libdnf and libsolv. Replaces YUM.

Dandified YUM Dandified YUM (DNF) is the next upcoming major version of YUM. It does package management using RPM, libsolv and hawkey libraries. For m

1.1k Dec 26, 2022
Python Environment & Package Manager

Python Environment Manager A Visual Studio Code extension that provides the ability to via and manage all of your Python environments & packages from

Don Jayamanne 72 Dec 29, 2022
PokerFace is a Python package for various poker tools.

PokerFace is a Python package for various poker tools. The following features are present in PokerFace... Types for cards and their componen

Juho Kim 21 Dec 29, 2022
[DEPRECATED] YUM package manager

⛔ This project is deprecated. Please use DNF, the successor of YUM. YUM Yum is an automatic updater and installer for rpm-based systems. Included prog

111 Dec 20, 2022
Easy to use, fast, git sourced based, C/C++ package manager.

Yet Another C/C++ Package Manager Easy to use, fast, git sourced based, C/C++ package manager. Features No need to install a program, just include the

31 Dec 21, 2022
Cilantropy: a Python Package Manager interface created to provide an "easy-to-use" visual and also a command-line interface for Pythonistas.

Cilantropy Cilantropy is a Python Package Manager interface created to provide an "easy-to-use" visual and also a command-line interface for Pythonist

48 Dec 16, 2022
An installation and dependency system for Python

Pyflow Simple is better than complex - The Zen of Python Pyflow streamlines working with Python projects and files. It's an easy-to-use CLI app with a

David O'Connor 1.2k Dec 23, 2022