Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.87 KB

File metadata and controls

62 lines (41 loc) · 1.87 KB

mahjong

PyPI License Supported Python versions PyPI Downloads Linters and tests API Docs

Japanese riichi mahjong hand calculator library.

Compute hand cost (han, fu, yaku, and scores), validate winning hands, and calculate shanten (minimum tiles to tenpai).

The code was validated on tenhou.net phoenix replays in total on 26,148,038 hands.

So, we can say that our hand calculator works the same way that tenhou.net hand calculation.

Documentation

How to install

pip install mahjong

Local development setup

To set up the project locally for development:

  1. Clone the repository:

    git clone https://github.com/MahjongRepository/mahjong.git
    cd mahjong
  2. Setup env using uv:

    uv sync
  3. Run tests to verify setup:

    make tests
    # Or directly:
    uv run pytest
  4. Run full checks before committing:

    make check   # Runs format, lint, and tests

License

This library is licensed under the MIT license.