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
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
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
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
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
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 Packaging Authority 345 Dec 28, 2022
Python Development Workflow for Humans.

Pipenv: Python Development Workflow for Humans [ ~ Dependency Scanning by PyUp.io ~ ] Pipenv is a tool that aims to bring the best of all packaging wo

Python Packaging Authority 23.5k Jan 06, 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
Template repo for a GCP-hosted REST API with automatic API versioning and custom domain mapping

Python + Poetry REST API with FastAPI, hosted on GCP This template will get you ready to deploy a FastAPI app in Google Cloud with automatic API versi

Kevin Duff 10 Dec 25, 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
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
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 Packaging Authority 345 Dec 28, 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
The Python Package Index

Warehouse Warehouse is the software that powers PyPI. See our development roadmap, documentation, and architectural overview. Getting Started You can

Python Packaging Authority 3.1k Jan 01, 2023
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 5.1k Dec 30, 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
Library Management System

Library Management Library Management System How to Use run main.py python file. python3 main.py Links Download Source Code: Click Here My Github Aco

Mohammad Dori 3 Jul 15, 2022
The Fast Cross-Platform Package Manager

The Fast Cross-Platform Package Manager part of mamba-org Package Manager mamba Package Server quetz Package Builder boa mamba Mamba is a reimplementa

Mamba 4k Dec 30, 2022
A flexible package manager that supports multiple versions, configurations, platforms, and compilers.

Spack Spack is a multi-platform package manager that builds and installs multiple versions and configurations of software. It works on Linux, macOS, a

Spack 3.1k Jan 09, 2023
OS-agnostic, system-level binary package manager and ecosystem

Conda is a cross-platform, language-agnostic binary package manager. It is the package manager used by Anaconda installations, but it may be used for

Conda 5.1k Jan 07, 2023
A PDM plugin that packs your packages into a zipapp

pdm-packer A PDM plugin that packs your packages into a zipapp Requirements pdm-packer requires Python =3.7 Installation If you have installed PDM wi

Frost Ming 23 Dec 29, 2022