Skip to main content

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

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.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mahjong 2.3.0
File Size Uploaded Provenance Actions
mahjong-2.3.0.tar.gz 54.7 kB With provenance Details for mahjong-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mahjong 2.3.0
File Interpreter ABI Platform Actions
mahjong-2.3.0-py3-none-any.whl Python 3 none any Details for mahjong-2.3.0-py3-none-any.whl

Total release size: 143.0 kB

Release files / mahjong-2.3.0.tar.gz

Download URL mahjong-2.3.0.tar.gz
Size 54.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1c214eafc0ad97226c542b59a346723c4e15eb0f194b6dc9439fbc6b55b75c06
BLAKE2b-256 checksum
How to use checksums
b4bc2a41aac3ba8250c26e60df9406c1e05ae5e8902ca4b8acb35dee6aae619f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / mahjong-2.3.0-py3-none-any.whl

Download URL mahjong-2.3.0-py3-none-any.whl
Size 88.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
536b93a3940a179c17494c5c5c9e388c4d52dbadd395ff7f6d941059f7f7742d
BLAKE2b-256 checksum
How to use checksums
81649ff6adf0b91103184cee8b3ef0485758146d387815e3af1119d623866897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for mahjong 2.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mahjong-2.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page