Skip to content

mitchallen/python-coin-flip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mitchallen Python Packages

A monorepo containing Python utilities for coin flipping and dice rolling simulations.

Packages

PyPI version Python versions Downloads

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% probability

View Documentation →

PyPI version Python versions Downloads

A 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 die

View Documentation →

Installation

Install packages individually:

pip install mitchallen-coin
pip install mitchallen-roll

Or with uv:

uv add mitchallen-coin
uv add mitchallen-roll

Development

Prerequisites

  • Python 3.12+
  • uv package manager

Setup

# 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

Common Commands

# Run all tests
make test-all

# Lint all packages
make lint-all

# Format all packages
make format-all

# Clean build artifacts
make clean-all

Package-Specific Commands

For mitchallen-coin:

make test-coin        # Run tests
make lint-coin        # Run linters
make build-coin       # Build package
make publish-coin     # Publish to PyPI

For mitchallen-roll:

make test-roll        # Run tests
make lint-roll        # Run linters
make build-roll       # Build package
make publish-roll     # Publish to PyPI

Run make help to see all available commands.

Repository Structure

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

Publishing

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-roll

Contributing

See CONTRIBUTING.md for development guidelines.

License

MIT License - see LICENSE file for details.

Author

Mitch Allen

Links

About

A simple Python package that provides a coin flip random number generator

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors