A monorepo containing Python utilities for coin flipping and dice rolling simulations.
A simple coin flip utility for 50/50 decisions and boolean outcomes.
from mitchallen.coin import flip, heads, tails
result = flip() # Returns True or False with 50% probabilityA dice rolling utility for games and simulations.
from mitchallen.roll import roll, d6, d20
result = roll() # Roll a 6-sided die (returns 1-6)
result = roll(20) # Roll a 20-sided die (returns 1-20)
result = d6() # Roll a 6-sided die
result = d20() # Roll a 20-sided dieInstall packages individually:
pip install mitchallen-coin
pip install mitchallen-rollOr with uv:
uv add mitchallen-coin
uv add mitchallen-roll- Python 3.12+
- uv package manager
# Clone the repository
git clone https://github.com/mitchallen/python-coin-flip.git
cd python-coin-flip
# Sync dependencies for all packages
make sync-all# Run all tests
make test-all
# Lint all packages
make lint-all
# Format all packages
make format-all
# Clean build artifacts
make clean-allFor mitchallen-coin:
make test-coin # Run tests
make lint-coin # Run linters
make build-coin # Build package
make publish-coin # Publish to PyPIFor mitchallen-roll:
make test-roll # Run tests
make lint-roll # Run linters
make build-roll # Build package
make publish-roll # Publish to PyPIRun make help to see all available commands.
python-coin-flip/
├── packages/
│ ├── mitchallen-coin/ # Coin flip package
│ │ ├── mitchallen/
│ │ │ └── coin/
│ │ ├── tests/
│ │ ├── pyproject.toml
│ │ └── README.md
│ └── mitchallen-roll/ # Dice roll package
│ ├── mitchallen/
│ │ └── roll/
│ ├── tests/
│ ├── pyproject.toml
│ └── README.md
├── Makefile # Monorepo commands
└── README.md # This file
Each package is versioned and published independently:
- mitchallen-coin: Uses tags like
v1.0.9 - mitchallen-roll: Uses tags like
roll-v1.0.9
To publish a package:
# Publish coin (increments patch version, commits, tags, and publishes)
make publish-coin
# Publish roll (increments patch version, commits, tags, and publishes)
make publish-rollSee CONTRIBUTING.md for development guidelines.
MIT License - see LICENSE file for details.
Mitch Allen