Skip to content

Implementation of riichi mahjong related stuff (hand cost, shanten, agari end, etc.)

License

Notifications You must be signed in to change notification settings

MahjongRepository/mahjong

Repository files navigation

mahjong

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

This library can calculate hand cost (han, fu with details, yaku, and scores) for riichi mahjong (Japanese version).

Also calculating of shanten is supported.

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.

About

Implementation of riichi mahjong related stuff (hand cost, shanten, agari end, etc.)

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors