This release is a pre-release and may not be stable for production use.
mahjong
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: 26,148,050 four-player and 8,406,421 three-player winning hands.
So, we can say that our hand calculator works the same way that tenhou.net hand calculation.
Documentation
- API reference
- Wiki — Supported rules and usage examples
How to install
pip install mahjong
Contributing
For guidance on setting up a development environment and contributing to mahjong, see Contributing to mahjong.
License
This library is licensed under the MIT license.
Metadata
Release files for mahjong 2.2.0.dev1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mahjong-2.2.0.dev1.tar.gz | 54.5 kB | Without provenance | Details for mahjong-2.2.0.dev1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mahjong-2.2.0.dev1-py3-none-any.whl | Python 3 | none | any | Details for mahjong-2.2.0.dev1-py3-none-any.whl |
Total release size: 142.7 kB
Release files / mahjong-2.2.0.dev1.tar.gz
| Download URL | mahjong-2.2.0.dev1.tar.gz |
|---|---|
| Size | 54.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73fdc94d94954c1fcaa2713936d714508cfb99c859ae31544e6425839bcfcee1
|
|
BLAKE2b-256 checksum How to use checksums |
18f792a3b5e4a6dd5ad7cd1c937169f45df9b4b4614b81eec0d0ede53d7f83aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / mahjong-2.2.0.dev1-py3-none-any.whl
| Download URL | mahjong-2.2.0.dev1-py3-none-any.whl |
|---|---|
| Size | 88.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
faa0ca1959d7ad85764689b32c8f296dc144362e323dd780a86530e78f7930e5
|
|
BLAKE2b-256 checksum How to use checksums |
728d213c509887d2848c6341f116d36bc2999b2e3c7ca107e585f4bda4dcaad5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for mahjong 2.2.0.dev1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.