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
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
:package: :fire: Python project management. Manage packages: convert between formats, lock, install, resolve, isolate, test, build graph, show outdated, audit. Manage venvs, build package, bump version.

THE PROJECT IS ARCHIVED Forks: https://github.com/orsinium/forks DepHell -- project management for Python. Why it is better than all other tools: Form

DepHell 1.7k Dec 30, 2022
Install All Basic Termux Packages To Your Phone

~All-Packages~ The Easiest Way To Install All Termux Packages 🤗 Tool By ⒹⓈ᭄ʜʏᴅʀᴀ✘๛ˢᴸ 👇 Contact Me On 👇 AVAILABLE ON : Termux TESTED ON : Term

ⒹⓈ ʜʏͥᴅᷧʀᷟᴀ✘๛ˢᴸ 7 Nov 12, 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
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 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
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
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
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
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
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
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
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
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
local pypi server (custom packages and auto-mirroring of pypi)

localshop A PyPI server which automatically proxies and mirrors PyPI packages based upon packages requested. It has support for multiple indexes and t

Michael van Tellingen 383 Sep 23, 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
[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
A tool to upgrade dependencies to the latest versions

pip-check-updates A tool to upgrade dependencies to the latest versions, inspired by npm-check-updates Install From PyPi pip install pip-check-updates

Zeheng Li 12 Jan 06, 2023