A simple, lightweight Python package for dice rolling simulations with customizable sides, perfect for games, RPGs, and probabilistic applications
Project description
mitchallen-roll
A simple dice rolling random number generator for Python.
Installation
pip install mitchallen-roll
Or with uv:
uv add mitchallen-roll
Usage
from mitchallen.roll import roll, d6, d20
# Roll a standard 6-sided die
result = roll() # Returns 1-6
# Roll a custom die
result = roll(20) # Returns 1-20
# Convenience functions
result = d6() # Roll a 6-sided die
result = d20() # Roll a 20-sided die
API Reference
roll(sides=6) -> int
Roll a die with the specified number of sides.
Parameters:
sides(int): Number of sides on the die (default: 6, minimum: 1)
Returns:
int: A random integer from 1 to sides (inclusive)
Raises:
ValueError: If sides is less than 1
d6() -> int
Convenience function to roll a 6-sided die.
Returns:
int: A random integer from 1 to 6
d20() -> int
Convenience function to roll a 20-sided die.
Returns:
int: A random integer from 1 to 20
Development
See the main repository README for development setup instructions.
License
MIT License - see LICENSE file for details
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mitchallen_roll-1.0.14.tar.gz.
File metadata
- Download URL: mitchallen_roll-1.0.14.tar.gz
- Upload date:
- Size: 31.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90536d80cde2a6753ee64a0f9ac89a25dc7d10d5bb4bdd80799275baf42fb2af
|
|
| MD5 |
0b43f1102b47cdbf30590bfe416a1a05
|
|
| BLAKE2b-256 |
446f780184f43bff40313fa02bee24ccd9890af7995414edfc409cc0946cd2c4
|
Provenance
The following attestation bundles were made for mitchallen_roll-1.0.14.tar.gz:
Publisher:
publish-roll.yml on mitchallen/python-coin-flip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mitchallen_roll-1.0.14.tar.gz -
Subject digest:
90536d80cde2a6753ee64a0f9ac89a25dc7d10d5bb4bdd80799275baf42fb2af - Sigstore transparency entry: 708531928
- Sigstore integration time:
-
Permalink:
mitchallen/python-coin-flip@c36ae70cc0508e94ecb2b6de0c1ee2915220ac0d -
Branch / Tag:
refs/tags/roll-v1.0.14 - Owner: https://github.com/mitchallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-roll.yml@c36ae70cc0508e94ecb2b6de0c1ee2915220ac0d -
Trigger Event:
push
-
Statement type:
File details
Details for the file mitchallen_roll-1.0.14-py3-none-any.whl.
File metadata
- Download URL: mitchallen_roll-1.0.14-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b397d1a40708463c9ec16a4bf8aa9348de97b874fd034dae465d04f18f09672
|
|
| MD5 |
ba74281e7251e972a12719dc8d02a145
|
|
| BLAKE2b-256 |
38333ff839d6bae0e55fe55f3f455d54c58f4911cecd0787908560159016e468
|
Provenance
The following attestation bundles were made for mitchallen_roll-1.0.14-py3-none-any.whl:
Publisher:
publish-roll.yml on mitchallen/python-coin-flip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mitchallen_roll-1.0.14-py3-none-any.whl -
Subject digest:
5b397d1a40708463c9ec16a4bf8aa9348de97b874fd034dae465d04f18f09672 - Sigstore transparency entry: 708531932
- Sigstore integration time:
-
Permalink:
mitchallen/python-coin-flip@c36ae70cc0508e94ecb2b6de0c1ee2915220ac0d -
Branch / Tag:
refs/tags/roll-v1.0.14 - Owner: https://github.com/mitchallen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-roll.yml@c36ae70cc0508e94ecb2b6de0c1ee2915220ac0d -
Trigger Event:
push
-
Statement type: