Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.2.0.dev2

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.2.0.dev2
File Size Uploaded Provenance Actions
mahjong-2.2.0.dev2.tar.gz 54.5 kB With provenance Details for mahjong-2.2.0.dev2.tar.gz

Built distribution (wheel)

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

Total release size: 142.7 kB

Release files / mahjong-2.2.0.dev2.tar.gz

Download URL mahjong-2.2.0.dev2.tar.gz
Size 54.5 kB
Tags Source
SHA-256 checksum
How to use checksums
92faa9d757bc9042eaf430fc9c07644252c0bb9792aabb612848cfd385aa31e9
BLAKE2b-256 checksum
How to use checksums
4fbbc08845fccd4f3775a5da1295d53155420ac00f70291577628f11f0c160e4
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 12, 2026.

Transparency log

Release files / mahjong-2.2.0.dev2-py3-none-any.whl

Download URL mahjong-2.2.0.dev2-py3-none-any.whl
Size 88.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cd095a55d99b1938528a4bb463703ddd8afe2d958ff86c56b2249d45b52d7278
BLAKE2b-256 checksum
How to use checksums
d0e0f7c51440b9a38ef8d7c4a6fa5b5988c762236207306b445eb5fcef056070
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 12, 2026.

Transparency log

Security for mahjong 2.2.0.dev2

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.2.0.dev2.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 12, 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
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