Skip to main content

ms_toollib

pypi MIT docs

A cross-platform minesweeper algorithm toolbox with a native Rust core.

Supports Python 3.7–3.13 on Windows, Linux, and macOS.


Installation

pip install ms_toollib

No additional dependencies required.


Features

Category Description
Mine Laying Random mine placement (first-click safe, Win7-style), no-guess mine generation (filter & adjustment methods)
Board Metrics 3BV, 3BV/s, openings (Op), islands (Isl), ZiNi (Greedy/Human/Random)
Probabilities Per-cell mine probability with block decomposition and enumeration
Deduction Solver 3-tier solver: direct subset, subtract-and-compare, full enumeration (≤55 cells)
Solvability Check Determine if a board is no-guess, find unsolvable structures
Game State Machine MinesweeperBoard / SafeMinesweeperBoard that accepts mouse clicks and tracks full game state
Replay Parsing Read AVF, EVF, MVF, RMV formats; save/write EVF (v0–v4) and EVFS containers
Optical Recognition Recognize board state from an RGBA image via ONNX neural network (Sobel, Hough, DP)

Quick Start

import ms_toollib as ms

# Generate a no-guess Beginner board
board = ms.laymine_solvable(9, 9, 10)
print(ms.cal_bbbv(board))          # 3BV
print(ms.cal_zini(board, 1))       # Greedy ZiNi

# Per-cell mine probability
prob = ms.cal_probability_onboard(board, 10)

# Parse a replay
video = ms.AvfVideo("replay.avf")
video.parse()
video.analyse()
print(video.bbbv)

See the full documentation for detailed API references.


Public API

Functions (30+): cal_all_solution, cal_bbbv, cal_board_numbers, cal_hzini, cal_op, cal_probability, cal_probability_onboard, cal_rzini, cal_zini, get_all_not_and_is_mine_on_board, is_able_to_solve, is_guess_while_needless, is_solvable, laymine, laymine_op, laymine_solvable, laymine_solvable_adjust, laymine_solvable_thread, mark_board, obr_board, refresh_board, refresh_matrix, refresh_matrixs, refresh_matrixses, sample_bbbvs_exp, solve_direct, solve_enumerate, solve_minus, unsolvable_structure, valid_time_period

Classes (15): AvfVideo, BaseVideo, Board, EvfVideo, Evfs, EvfsCell, GameBoard, KeyDynamicParams, MinesweeperBoard, MvfVideo, RmvVideo, SafeBoard, SafeBoardRow, SafeMinesweeperBoard, VideoActionStateRecorder


Supported Platforms

OS Architectures
Windows x86, x64
Linux x86, x86_64, aarch64, armv7, ppc64le, s390x
macOS x86_64, aarch64

Source & Issues

Generate Python Type Stubs

The source-based generator requires Python 3.10+ and two development-only packages:

pip install "tree-sitter>=0.25,<0.27" "tree-sitter-rust>=0.24,<0.25"
python python_package/generate_pyi.py --compare python_package/ms_toollib.pyi

Run from the repository root. By default this writes python_package/ms_toollib.generated.pyi, leaving the existing stub unchanged. Use --output python_package/ms_toollib.pyi to explicitly replace the package stub. Use --check to verify the output is current without writing it, and --diff with --compare for a full text diff in addition to the semantic API report.

The generator parses registered PyO3 functions and classes, renamed bindings, constructors, properties, signatures/defaults, documentation and nested Rust types. It expands the single-identifier generate_video! template used here. Unregistered event classes referenced by signatures are emitted as private support types. Getter-only properties remain read-only; setter-only properties use writable attribute annotations. Complex Rust default expressions use ....

This is a source parser, not a Rust compiler: general macro expansion, conditional compilation, externally defined types and arbitrary PyO3 extensions are not supported. Unknown Rust types and unsupported top-level macros cause an error. PyAny remains Any; types selected dynamically inside Rust function bodies cannot be recovered from signatures. API comparison normalizes typing.List and typing.Tuple aliases, but is not a complete type-equivalence checker.

Regression tests: python -m unittest discover -s python_package -p test_generate_pyi.py.

Metadata

Release files for ms_toollib 1.6.3

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

Source distribution (sdist)

Source distribution for ms_toollib 1.6.3
File Size Uploaded Provenance Actions
ms_toollib-1.6.3.tar.gz 371.0 kB Without provenance Details for ms_toollib-1.6.3.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ms_toollib 1.6.3
File Actions
ms_toollib-1.6.3-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details for ms_toollib-1.6.3-cp38-abi3-win_amd64.whl
ms_toollib-1.6.3-cp38-abi3-win32.whl CPython 3.8 abi3 Windows x86-32 Details for ms_toollib-1.6.3-cp38-abi3-win32.whl
ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_x86_64.whl CPython 3.8 abi3 Linux musl 1.2+ x86-64 Details for ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_x86_64.whl
ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_i686.whl CPython 3.8 abi3 Linux musl 1.2+ x86-32 Details for ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_i686.whl
ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_aarch64.whl CPython 3.8 abi3 Linux musl 1.2+ ARM64 Details for ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_aarch64.whl
ms_toollib-1.6.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details for ms_toollib-1.6.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ms_toollib-1.6.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details for ms_toollib-1.6.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ms_toollib-1.6.3-cp38-abi3-manylinux2010_i686.manylinux_2_12_i686.whl CPython 3.8 abi3 Linux glibc 2.12+ x86-32 Details for ms_toollib-1.6.3-cp38-abi3-manylinux2010_i686.manylinux_2_12_i686.whl
ms_toollib-1.6.3-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details for ms_toollib-1.6.3-cp38-abi3-macosx_11_0_arm64.whl
ms_toollib-1.6.3-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details for ms_toollib-1.6.3-cp38-abi3-macosx_10_12_x86_64.whl

Total release size: 36.0 MB

Release files / ms_toollib-1.6.3.tar.gz

Download URL ms_toollib-1.6.3.tar.gz
Size 371.0 kB
Tags Source
SHA-256 checksum
How to use checksums
61eaa8b93f34154a5c269a2451895f6073155d30489dddda7a2dcbf52a77ad5d
BLAKE2b-256 checksum
How to use checksums
d63d5c42a30fa8916d8105b57459ce29345ddd139fd0210617a25205a403e4a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-win_amd64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-win_amd64.whl
Size 3.7 MB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
e4d971b8493ac9d9cd7d86f43b50732a0d2680f21e654bd47cbc07eec0523067
BLAKE2b-256 checksum
How to use checksums
409f70fb5e608ec0154aa594506a4f97f8fc2c0f128462e38bc11680424a5a44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-win32.whl

Download URL ms_toollib-1.6.3-cp38-abi3-win32.whl
Size 3.0 MB
Tags CPython 3.8 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
46f1529c9ced37aea4610d22a67130bdee612b9db7903bb2d65313736eb9acd7
BLAKE2b-256 checksum
How to use checksums
b3cda5e60cb315a83bb39b4ef6e92405de814671a9538a8018a878fa110849d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_x86_64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_x86_64.whl
Size 4.0 MB
Tags CPython 3.8 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
ca8cbb450e44ec83d91628d207cb9d64674889c31a823f77f83a7dbd788501c1
BLAKE2b-256 checksum
How to use checksums
deb637070adb66a25a719980bbdca1b27c1621eb94c536e719fcfdcfc8b043cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_i686.whl

Download URL ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_i686.whl
Size 3.5 MB
Tags CPython 3.8 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
f8430107bdda809036c5ecc55a12b00130cb43f484facf3191548904874633c8
BLAKE2b-256 checksum
How to use checksums
35f6777e1c7d9ff582ccdd8b14a2c91d10821abc16dce54f98b13d019a63c0a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_aarch64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-musllinux_1_2_aarch64.whl
Size 3.9 MB
Tags CPython 3.8 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
e8e8e292da6f7a030280e1d76e59b5ca2886912b3c1ff4bdd5ed8d21fcc6877d
BLAKE2b-256 checksum
How to use checksums
62cf19f02f6e1220efabd3935631d86609933ca476a87c970d34aa27ec2acc07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 3.7 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bb79413bd5c0fff0d56a36b51d0523e135c48698431beacd1231aa8d134a0717
BLAKE2b-256 checksum
How to use checksums
028c2fa3cfee4cae102de6d904d26915b856da9224e76d2ab943f257c5d14124
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 3.8 MB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
a3db1d58738b471ad77f169729fb19df8a6411a3d16a236b5d3eaf3eb19d22a6
BLAKE2b-256 checksum
How to use checksums
5e42d305ab12de8dee46253e2cfac16bce4678e610c0d53a6d1403c390f48545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-manylinux2010_i686.manylinux_2_12_i686.whl

Download URL ms_toollib-1.6.3-cp38-abi3-manylinux2010_i686.manylinux_2_12_i686.whl
Size 3.4 MB
Tags CPython 3.8 Linux glibc 2.12+ x86-32 abi3
SHA-256 checksum
How to use checksums
a8a867d8c6b5f25e9209e2e742fc61818c05929c7dbba0ddb2f1a9e67dcd43c5
BLAKE2b-256 checksum
How to use checksums
dbf525021b29ee4c2a78887987646db4e9510dda1fcb486e72551b3bac677f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-macosx_11_0_arm64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-macosx_11_0_arm64.whl
Size 3.3 MB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
102b62e9be1f0d61bb60cb7163571dec317b3a5d3951d92f14f1edf33d859db8
BLAKE2b-256 checksum
How to use checksums
48e9dddd4d2204a0e472dd55dedf5ba94a0f628b250a9e8efb7e3e4d86ce74d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 / ms_toollib-1.6.3-cp38-abi3-macosx_10_12_x86_64.whl

Download URL ms_toollib-1.6.3-cp38-abi3-macosx_10_12_x86_64.whl
Size 3.3 MB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
30575c847bad58ffa56845db168676591f542c5a0cd76a5e38add6a1a42e5002
BLAKE2b-256 checksum
How to use checksums
6f2f1652973810d74fe8da6d0cabbb5d9d0d03dcffdc04c6c847937cb95fb1e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","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 ms_toollib 1.6.3

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.

Release history Release notifications | RSS feed

This release

1.6.3 This release

11 release files No 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