{"id":28310,"library":"sudoku-rust","title":"sudoku-rust","description":"A high-performance Sudoku solver, generator, and validator backed by Rust, with a Python wrapper. Current version 1.0.7, release cadence is irregular. Supports Python >=3.8.","status":"active","version":"1.0.7","language":"python","source_language":"en","source_url":"https://github.com/klamike/sudoku-rust","tags":["sudoku","rust","solver","generator"],"install":[{"cmd":"pip install sudoku-rust","lang":"bash","label":"install via pip"}],"dependencies":[{"reason":"Build backend for Rust-Python bindings","package":"maturin","optional":true}],"imports":[{"note":"Package name uses hyphens, Python module uses underscores.","wrong":"from sudoku import Sudoku","symbol":"Sudoku","correct":"from sudoku_rust import Sudoku"},{"note":"","wrong":"","symbol":"generate_puzzle","correct":"from sudoku_rust import generate_puzzle"},{"note":"","wrong":"","symbol":"solve","correct":"from sudoku_rust import solve"}],"quickstart":{"code":"from sudoku_rust import Sudoku, generate_puzzle, solve\n\n# Generate a 9x9 puzzle with difficulty 0.5 (0=easy, 1=hard)\npuzzle = generate_puzzle(0.5)\nprint(\"Puzzle:\", puzzle)\n\n# Create a Sudoku instance and solve\nsudoku = Sudoku(puzzle)\nsolution = solve(sudoku)\nprint(\"Solution:\", solution)","lang":"python","description":"Generate a Sudoku puzzle and solve it."},"warnings":[{"fix":"Install Rust via rustup (https://rustup.rs) and then reinstall the package: 'pip install sudoku-rust --no-binary sudoku-rust'.","message":"The library is a wrapper around Rust code, and on some platforms (e.g., ARM Linux) the pre-built wheels may not be available, requiring Rust toolchain to build from source.","severity":"breaking","affected_versions":"all"},{"fix":"Ensure input grids use integer 0 for blanks. Example: [[5,3,0,0,7,0,0,0,0], ...].","message":"The puzzle representation uses 0 for empty cells, not '.' or other placeholders.","severity":"gotcha","affected_versions":"all"},{"fix":"Expect nested list format; if you need a different format, convert accordingly.","message":"The generate_puzzle function returns a list of lists (nested list), not a NumPy array or flat list.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use 'from sudoku_rust import Sudoku' (note the underscore).","cause":"Improper import: 'sudoku' instead of 'sudoku_rust'.","error":"ModuleNotFoundError: No module named 'sudoku_rust'"},{"fix":"Install Rust or request a pre-built wheel for your platform.","cause":"May occur if the Rust extension failed to build (missing Rust toolchain).","error":"ImportError: cannot import name 'Sudoku' from 'sudoku_rust'"},{"fix":"Call generate_puzzle(difficulty) where difficulty is a float between 0 and 1.","cause":"Calling generate_puzzle() without arguments.","error":"TypeError: generate_puzzle() missing 1 required positional argument: 'difficulty'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}