Skip to main content
Logo

clubs_gym

PyPI Status PyPI Status codecov CodeFactor

clubs_gym is a gym wrapper around the clubs python poker library. clubs is used for running arbitrary configurations of community card poker games. This includes anything from simple Leduc or Kuhn poker to full n-player No Limit Texas Hold'em or Pot Limit Omaha.

Install

Install using pip install clubs-gym.

How to use

By running import clubs_gym, several pre-defined poker clubs poker configurations are registered with gym (call clubs_gym.ENVS for a full list). Custom environments can be registered with clubs_gym.envs.register({"{environment_name}": {config_dictionary})}. Environment names must follow the gym environment name convention ({title-case}-v{version_number}). Check the clubs documentation for additional information about the structure of a configuration dictionary.

Since gym isn't designed for multi-agent games, the api is extended to enable registering agents. This is not required, but ensures each agent only receives the information it's supposed to. An agent needs to inherit from the clubs_gym.agent.base.BaseAgent class and implement the act method. act receives a game state dictionary and needs to output an integer bet size. A list of agents the length of the number of players can then be registered with the environment using env.register_agents. By calling env.act({observation_dictionary}), the observation dictionary is passed to the correct agent and the agent's bet is returned. This can then be passed on the env.step function. An example with an optimal Kuhn agent (clubs_gym.agent.kuhn.NashKuhnAgent) is given below.

Example

import gym

import clubs_gym

env = gym.make("KuhnTwoPlayer-v0")
env.register_agents([clubs_gym.agent.kuhn.NashKuhnAgent(0.3)] * 2)
obs = env.reset()

while True:
    bet = env.act(obs)
    obs, rewards, done, info = env.step(bet)

    if all(done):
        break

print(rewards)

Metadata

Release files for clubs-gym 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clubs-gym 0.1.4
File Size Uploaded Provenance Actions
clubs-gym-0.1.4.tar.gz 21.1 kB Without provenance Details for clubs-gym-0.1.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for clubs-gym 0.1.4
File Interpreter ABI Platform Actions
clubs_gym-0.1.4-py3-none-any.whl Python 3 none any Details for clubs_gym-0.1.4-py3-none-any.whl

Total release size: 41.8 kB

Release files / clubs-gym-0.1.4.tar.gz

Download URL clubs-gym-0.1.4.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b7a502e1551a0f7dc79b7fe9909b884cd44b197e944d0579ae58977f9cee5d58
BLAKE2b-256 checksum
How to use checksums
916dbef9e0b2d18e0a1b175d7674acdd4766b3d395b967944b70946a72860655
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Release files / clubs_gym-0.1.4-py3-none-any.whl

Download URL clubs_gym-0.1.4-py3-none-any.whl
Size 20.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1cffad4bef03b52cbc0ee0d57bcfcd8d8b63b1a7a55627f3d250018ee44df66d
BLAKE2b-256 checksum
How to use checksums
c2561fed55b29f67385624de5b19787adfd0b97417b95d277cb082127df679ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

Security for clubs-gym 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page