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.19
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.19.tar.gz | 314.6 kB | Details |
Built distributions (wheels)
Total release size: 29.4 MB
Release files / ms_toollib-1.5.19.tar.gz
| Download URL | ms_toollib-1.5.19.tar.gz |
|---|---|
| Size | 314.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7476d3aa10ad9acca4f232c295d46f1e150a6b460613d6d3f3d7ac7283fb5697
|
|
BLAKE2b-256 checksum How to use checksums |
75b5d7e177977c383661d75b67b47dc034391029a4acfde45c07c80728c81e47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-win_amd64.whl
| Download URL | ms_toollib-1.5.19-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 2.7 MB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
65816a5d92c2af07c72f60074e28dfd6dc1b4f50aa17a476bf504377eecf9542
|
|
BLAKE2b-256 checksum How to use checksums |
055f4a1f542188abee518431115f7178cfa9e18d0a34d1d263d263af0f766767
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-win32.whl
| Download URL | ms_toollib-1.5.19-cp38-abi3-win32.whl |
|---|---|
| Size | 2.3 MB |
| Tags | CPython 3.8 Windows x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
174b401bc95af50e26271005449cde050679d801182c4086e298b9dd840f7b67
|
|
BLAKE2b-256 checksum How to use checksums |
1e9d0d2dc694302f042bb926f1d108dc533831a736178129d2acbcdc8c15e271
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-musllinux_1_2_x86_64.whl
| Download URL | ms_toollib-1.5.19-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 |
db7f94a518e2048f36ff976c9912a1837ef3adc82f412f07bdc049cdf7369531
|
|
BLAKE2b-256 checksum How to use checksums |
eee124af3e0672917c42c1991c576f9bed46fc4dd6f970a5800cfb6705db5cc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-musllinux_1_2_i686.whl
| Download URL | ms_toollib-1.5.19-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 |
d7cc4aa007bb813dcf545650e743fd06f38e757de90c59cf36b3e744cf99ffb5
|
|
BLAKE2b-256 checksum How to use checksums |
849f6ad5fcb13c868c07952005fd559f1a384089f8cd2355eab72ac6b8b609f2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-musllinux_1_2_aarch64.whl
| Download URL | ms_toollib-1.5.19-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 |
7787d12576e9cb13b1ed1f2610dab53459b187cafc3f863b0ef9c9ccf91c80ec
|
|
BLAKE2b-256 checksum How to use checksums |
a6682727a588774f01d826e85f85d57feabd9cb1ed7a01c80f3158ea217c807a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | ms_toollib-1.5.19-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 |
3c3141b69d5ee6c1a7bcd9446b7c0a32f58a87260a681f623241d5c4c56e863f
|
|
BLAKE2b-256 checksum How to use checksums |
3130043d098fc9df520790684c78fe47403bd441f9de7eefa369e6f1449628c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | ms_toollib-1.5.19-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 |
37300db11244214b5c4cf1d6eae65cfe4ddaa202f1dde7ed58fe9df75db21e29
|
|
BLAKE2b-256 checksum How to use checksums |
9b09e1c9b0de3448aae17cbc1836009d6bef8abd57db56bde65f78574834dfed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
| Download URL | ms_toollib-1.5.19-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 |
342bd481e586f189f9d483b3814d63d522c5d9ec770bad9c813a0572feef49c0
|
|
BLAKE2b-256 checksum How to use checksums |
be39ecea6621bc12467311b51e9c74307e3894f72ee48ba1abe853e0f7b8ecfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | ms_toollib-1.5.19-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 |
51325027e5094d726fddb563a667c5821954233590af1c77c32c4e2a3e16e7d2
|
|
BLAKE2b-256 checksum How to use checksums |
a8e1fa55ab015f1c0f5a05a4d359ebd5227b93fb62bd12b3bb4e73ed2271be95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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.19-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | ms_toollib-1.5.19-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 |
b0be68d0f10f4398b20b9acbe7dc250cc4c4c05590b09dab890a714c760bd18c
|
|
BLAKE2b-256 checksum How to use checksums |
46a71d48585737586b57a1df1f202bd4649d26ed24e0a90af1288259947f404a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.23 {"installer":{"name":"uv","version":"0.12.23","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}
|