Skip to main content

rustoku

GitHub Actions Workflow Status License: MIT

High-performance Sudoku solving and generation for Python, powered by a core Rust engine.

Installation

pip install rustoku

Quick Start

import rustoku

# 1. Generate a puzzle
puzzle = rustoku.generate("medium")
print("Generated puzzle:", puzzle)

# 2. Solve a puzzle
solution = rustoku.solve(puzzle)
print("Solved puzzle:   ", solution)

# 3. Check solution validity
assert rustoku.check(solution)

# 4. Generate with symmetry and difficulty
symmetric = rustoku.generate_advanced(symmetry="rotational180", difficulty="hard")

# 5. Find all solutions (or check for uniqueness)
solutions = rustoku.solve_all(puzzle)
print(f"Found {len(solutions)} solution(s)")

# 6. Step-by-step human technique solve trace
trace = rustoku.solve_steps(puzzle, difficulty="expert")
print(f"Solved in {len(trace)} steps")

Features

  • Blazing Fast: Solves puzzles in microseconds using bitmask constraint tracking and MRV backtracking.
  • Human-like Techniques: Explains steps using human solving strategies (Naked/Hidden Singles, Pairs, Triples, Quads, Pointing/Claiming, X-Wing, Swordfish, Jellyfish, Skyscraper, W-Wing, XY-Wing, XYZ-Wing, and AIC).
  • Flexible Generation: Generate valid, uniquely solvable Sudoku boards across multiple difficulty levels (easy, medium, hard, expert) and symmetry modes (rotational180, rotational90, mirrorvertical, mirrorhorizontal, mirrordiagonal).

Documentation

For full API documentation and advanced usage, see the Python Guide in the GitHub repository.

Release files for rustoku 0.15.1

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

Source distribution (sdist)

Source distribution for rustoku 0.15.1
File Size Uploaded
rustoku-0.15.1.tar.gz 65.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rustoku 0.15.1
File Interpreter ABI Platform
rustoku-0.15.1-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details

Total release size: 366.5 kB

Release files / rustoku-0.15.1.tar.gz

Download URL rustoku-0.15.1.tar.gz
Size 65.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ab03c44a8a6651f2c03ba8b306c5d6eeea31029fc8febaf19f41337f78a7e009
BLAKE2b-256 checksum
How to use checksums
67cac62820dab2748be04d137968962bd3501ac73346a27e3b5b74e1c68e34c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release files / rustoku-0.15.1-cp314-cp314-macosx_11_0_arm64.whl

Download URL rustoku-0.15.1-cp314-cp314-macosx_11_0_arm64.whl
Size 301.5 kB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4a7f6cf662182589c077d63bc239a61a2bfe8966acc610f1407c677fba9ae354
BLAKE2b-256 checksum
How to use checksums
d1d4070f9e2d25939e3423e4370adeba34ad6e4f331460bec2ebc09d0b2f6355
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/1.10.2

Release history Release notifications | RSS feed

This release

0.15.1 This release

2 release files

0.15.0

2 release files

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