ms_toollib
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
- GitHub: https://github.com/eee555/ms_toollib
- Documentation: https://docs.rs/ms_toollib/latest/ms_toollib
- PyPI: https://pypi.org/project/ms_toollib/
Metadata
Release files for ms_toollib 1.5.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ms_toollib-1.5.18.tar.gz | 314.7 kB | Details |
Built distributions (wheels)
Total release size: 29.4 MB
Release files / ms_toollib-1.5.18.tar.gz
| Download URL | ms_toollib-1.5.18.tar.gz |
|---|---|
| Size | 314.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
23a93222ebd1dca17bd361792e7204bba896d35d1dc5ab388be39febd3d7fdd7
|
|
BLAKE2b-256 checksum How to use checksums |
9c48a2e6fdc5bedb2dafbd826fd89d7aeab4f50a76ba8347da8edfe98c9a04ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-win_amd64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
8c45c64005dcf3b6eac66187087dd4f22fefd2a748e515c452e846dc1f59d71e
|
|
BLAKE2b-256 checksum How to use checksums |
1de19558f15f9241d1e79c52a0b51e94e3cab8061d8564976a9d599e7c9c5519
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-win32.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-win32.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
7a2ad95530b6299e445e61e29cb59185c94d31f645d3ba2be9878f68db870d6e
|
|
BLAKE2b-256 checksum How to use checksums |
626054684c7cd484b6ff54f6f288b2747ffe7a948c91c8323b5508b4399c81b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 3.4 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
5a4526499d21bfb58cc1c26a36e8a0da2a8e97364b272f84dce7f62317d52e25
|
|
BLAKE2b-256 checksum How to use checksums |
44c342565f3aaee1cba854121e1b8954cc2134ec84ad284c64b2068157a08e94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.8 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
9067782a53a2aac938a14da38f28da1cf61843ae42626a960d96406d15d84b5c
|
|
BLAKE2b-256 checksum How to use checksums |
b87bd24f0faa26f8fc76e66d96011ddaca0a3c7217e2bf6d3185d8d0effed505
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.8 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
83f7b3b16681256c35e08b4361ee08941308e1e79fbf3a7a62bee4a53e7859d8
|
|
BLAKE2b-256 checksum How to use checksums |
ee1a8e075859b42d274f7e23b701861cf48d0d02ba5a2bef6cf04bbfc185856f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
271a32e09a5da47bc7017428b166fbb967966f0a86c573c3fe07de05f563f70d
|
|
BLAKE2b-256 checksum How to use checksums |
789d1ace00213780f759f22d565b47c9a19c605f7497c4acce25df634a3a386e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 3.2 MB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
241845c531619c38830900e6a76d1d3dc2605e59b4dc32b9f777746a4aab447e
|
|
BLAKE2b-256 checksum How to use checksums |
3b943c85c6f8a7aa07ad458e2dd5a1d965a63925fb889f2e342a1293b94aa368
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.8 Linux glibc 2.12+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
f1068249533f98d4c62fa3263bc3186e32daae2db048e2cd0f1e9273e4162b56
|
|
BLAKE2b-256 checksum How to use checksums |
c3dd8a7eaaa2975ed6d14fc66da6ab59c5673be7950d51bd708efe8ff609a160
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 2.6 MB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2d8d1f04170a36deb859d342f8f51f17f3ce6855ad8d0d405cfc7b15e9030001
|
|
BLAKE2b-256 checksum How to use checksums |
999d8694eabd8793174a7e130d5bc04e242c6d03205dac361c6ab21f83f5b691
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.5.18-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | ms_toollib-1.5.18-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d43702e157f0f38314216d6754c73036ed7d5815a6796e18f378452e123b1c6d
|
|
BLAKE2b-256 checksum How to use checksums |
37f0e0a6daa7601f39980b3d5ad76f6dfae16ee7bc9518518f4aefc01f866df3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.17 {"installer":{"name":"uv","version":"0.12.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|