Skip to main content

:game_die::chart_with_upwards_trend: crapssim

PyPI GitHub Repo stars

When playing craps in a casino, there are unlimited combinations of ways that that players can place their bets. But, with this freedom comes complexity, and players deserve to know how a strategy could perform in each session. The 'crapssim' package is designed answer these tough questions: What's a fun strategy involving multiple numbers where the house edge doesn't increase too much? What's the best amount of passline or don't pass odds for my bankroll? Does hedging my bet improve my net winnings?

Crapssim is a python package which runs all of the necessary elements of a Craps table. The package follows some natural logic:

  • a Table has Player(s) and Dice on it
  • the Player(s) have Bet(s) on the Table
  • each Player's Strategy can automatically set up Bet(s)

With these building blocks, crapssim supports

  • running 1 session with 1 player/strategy to test a realistic day at the craps table,
  • running many sessions with 1 player/strategy to understand how a strategy performs in the long term, or
  • running many sessions with many players/strategies to simulate how they compare to each other

These powerful options can lead to some unique analysis of the game of craps, such as the following figure comparing 4 strategies with a budget of $200:

best-budget-strategies

It's easy to get started

To see how a single session might play out for you using a pass line bet with double odds, over 20 rolls, one might run:

import crapssim as craps
from crapssim.strategy import BetPassLine, PassLineOddsMultiplier

table = craps.Table()
your_strat = BetPassLine(5) + PassLineOddsMultiplier(2)

table.add_player(strategy=your_strat)
table.run(max_rolls=20, verbose=True)

To evaluate a couple of strategies across many table sessions, you can run:

import crapssim as craps

n_sim = 20
bankroll = 300
strategies = {
    "place68": craps.strategy.examples.PassLinePlace68(5),
    "ironcross": craps.strategy.examples.IronCross(5),
}

for i in range(n_sim):
    table = craps.Table()
    for s in strategies:
        table.add_player(bankroll, strategy=strategies[s], name=s)

    table.run(max_rolls=float("inf"), max_shooter=10, verbose=False)

    for p in table.players:
        print(f"{i}, {p.name}, {p.bankroll}, {bankroll}, {table.dice.n_rolls}")

For more advanced strategies, you can either write your own custom Strategy class or add strategy components together. To see the many possibilities, start with the tutorials on documentation site:

Installation

For a normal user, it is recommended to install the official release. You will need an installation of python version 3.10 or newer. Then, run the following code in your terminal:

pip install crapssim

Development installation instructions are also available.

Results

This simulator supports all of the analysis at crapsanalyst.com, including:

Contributing

If you discover something interesting using this simulator, please let me know so that I can highlight those results here. You can find me at skent259@gmail.com.

Those looking to contribute to this project are welcome to do so. Currently, the top priority is to improve

  • Supported strategies (see strategy)
  • Documentation

Metadata

Release files for crapssim 0.4.1

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

Source distribution (sdist)

Source distribution for crapssim 0.4.1
File Size Uploaded
crapssim-0.4.1.tar.gz 89.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for crapssim 0.4.1
File Interpreter ABI Platform
crapssim-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 192.3 kB

Release files / crapssim-0.4.1.tar.gz

Download URL crapssim-0.4.1.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8237deed0fde355bf495fcfa7016e2fd76bd8f61ab5841320ceb9212e44a0d25
BLAKE2b-256 checksum
How to use checksums
50897fc00288b7979020dac0064db17497c9a0d34d7f7992c734dd7d65f74f6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release files / crapssim-0.4.1-py3-none-any.whl

Download URL crapssim-0.4.1-py3-none-any.whl
Size 103.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bad14cb74f45bfd5572bdd9f614252ca2a3274d0572a98d171bcb7103befa146
BLAKE2b-256 checksum
How to use checksums
fa64ba77988e762b55c48a50d78b1d4c812b51872746f938ad1d520a3d8b5232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

3 release files

0.1.1

2 release files

0.1.0

2 release files

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