Metadata-Version: 2.4
Name: mahjong
Version: 1.3.0
Summary: Mahjong hands calculation
Author-email: Alexey Lisikhin <alexey@nihisil.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/MahjongRepository/mahjong
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Dynamic: license-file

[![Mahjong lib](https://github.com/MahjongRepository/mahjong/actions/workflows/lint_and_test.yml/badge.svg)](https://github.com/MahjongRepository/mahjong/actions/workflows/lint_and_test.yml)

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 **11,120,125 hands**.

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

# How to install

```bash
pip install mahjong
```

# Supported rules and usage examples

You can find usage examples and information about all supported rules variations in the [wiki](https://github.com/MahjongRepository/mahjong/wiki)

# Local development setup

To set up the project locally for development:

1. Clone the repository:
```bash
git clone https://github.com/MahjongRepository/mahjong.git
cd mahjong
```

2. Setup env using [uv](https://github.com/astral-sh/uv):
```bash
uv venv
```

3. Run tests to verify setup:
```bash
make tests
# Or directly:
uv run pytest
```

4. Run full checks before committing:
```bash
make check   # Runs format, lint, and tests
```
