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
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
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 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.1k Jan 01, 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
: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
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
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
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
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
A set of tools to keep your pinned Python dependencies fresh.

pip-tools = pip-compile + pip-sync A set of command line tools to help you keep your pip-based packages fresh, even when you've pinned them. You do pi

Jazzband 6.5k Dec 29, 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
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
A software manager for easy development and distribution of Python code

Piper A software manager for easy development and distribution of Python code. The main features that Piper adds to Python are: Support for large-scal

13 Nov 22, 2022
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
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
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
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
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
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