Skip to main content

Namishu Sudoku

Printable Sudoku puzzles, ready for a quiet moment.

Python 3.10+ License: MIT PDF: A4 portrait

English · 简体中文

An easy Sudoku puzzle with space to write answers

Namishu Sudoku is a small command-line tool that creates printable Sudoku puzzles. Choose a difficulty and page count to get an A4 PDF with two puzzles per page and room to fill in the numbers by hand. Use it to prepare classroom activities, share a puzzle at home, or take a few pages along on a trip.

You can generate fresh puzzles whenever you need them, without searching for worksheets or arranging screenshots on a page. Each puzzle has exactly one solution. For practice with a way to check your work, enable answers: the top half contains a puzzle and the bottom half contains its completed grid.

Sample PDFs: Two-puzzle worksheet · Puzzle–solution worksheet

Installation

Requires Python 3.10+. Install with uv or pip:

uv tool install namishu-sudoku
python -m pip install namishu-sudoku

Both methods provide the namishu-sudoku command. The default layout and Rubik Regular and Medium fonts are included, so no separate font installation is needed.

Quick start

Generate one page with two easy puzzles, saved as sudoku.pdf:

namishu-sudoku

Generate five pages of harder puzzles, ten puzzles in total:

namishu-sudoku --level hard --pages 5

Place an answer below each puzzle. This produces five pages with five puzzles and their answers:

namishu-sudoku --level hard --pages 5 --answers

Choose an output path and a seed to reproduce the puzzle content:

namishu-sudoku --level normal --seed 42 -o exercises/practice.pdf

The command prints the saved file location and page count. Relative paths are resolved from your current directory, and parent directories are created as needed. An existing output PDF is replaced after the new document is written successfully. You can also run python -m namishu_sudoku.

Print at actual size on A4 paper; fold along the divider to keep the answer out of sight.

Options

Option Purpose Default
--level LEVEL easy, normal, or hard easy
--pages N PDF page count; a positive integer 1
--answers Put each puzzle's solution in the lower half of the same page Off
-o, --output PATH PDF file location sudoku.pdf
--seed INTEGER Reproduce puzzle content with the same settings and version Random
--config PATH YAML overrides for layout and font Built-in settings
--help Show usage
--version Show the installed version

Answers are omitted by default. Without answers, every page contains two puzzles; with answers, every page contains one puzzle and its answer, with the original clues in muted bold gray and the filled-in answers in a muted teal. A seed reproduces puzzles with the same version and settings, not the exact PDF file bytes.

Difficulty

Choose one of three levels. Every puzzle has a unique solution and can be completed using the logical techniques allowed for its level, without guessing:

Level Solving techniques
easy A cell has only one possible number, or a number has only one possible place in a row, column, or box
normal Easy techniques, plus locked candidates and naked pairs
hard Normal techniques, plus hidden pairs, naked triples, and X-Wing

A normal puzzle must make the easy strategy stall; a hard puzzle must make the normal strategy stall. Ratings follow this tool's fixed technique order and may differ from other Sudoku apps. The number of given digits varies and does not determine the rating. Hard puzzles can take longer to generate. If no matching puzzle is found within the bounded search, the command reports an error and keeps any existing output PDF; it never silently substitutes an easier puzzle.

Customize the layout

Write only the settings you want to change. For example, save this as sudoku.yaml to use smaller numbers:

numbers:
  font_size: 22
namishu-sudoku --config sudoku.yaml

Unspecified settings keep their defaults, including the bundled font. The complete example configuration lists every setting and works as downloaded.

Setting How to customize it
Paper and margins page: width, height, and a uniform margin (margin)
Board board: width, vertical gap between boards (gap), line color
Numbers numbers: font size, puzzle clue color (color), muted answer clue color (answer_given_color), and filled-in answer color (answer_color)
Dashed middle divider separator: visibility and color
Custom fonts font: filled-in answers; bold_font: given clues; both are TrueType file paths

Distances are in millimeters; font sizes are in points. board.gap defaults to 30 mm, measured between the outer edges of the two board borders. page.margin applies to all four sides. Grid line weights and the divider’s dash pattern are fixed for consistent printing. Boards are placed symmetrically in the usable page area and centered horizontally, without labels or a footer. Quote hex colors, such as "#1f2c50". Unknown settings, invalid values, or layouts that cannot fit the content produce an error before an existing PDF is replaced.

For custom fonts, add font: fonts/MyFont-Regular.ttf and bold_font: fonts/MyFont-Medium.ttf to the YAML file. Both paths are relative to that file, or they can be absolute. Unspecified fonts keep their bundled defaults. Fonts are embedded in the PDF; unreadable fonts or missing digits produce an error. Given clues use the bold font in both the puzzle and its solution. Only numbers filled into originally empty cells use the regular font and answer color.

License

Code and original documentation use the MIT License. The bundled Rubik Regular and Medium fonts use the SIL Open Font License 1.1; that file also includes its attribution and source information. Generated puzzles may be printed, shared, modified, and sold.

Metadata

Release files for namishu-sudoku 0.1.0

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

Source distribution (sdist)

Source distribution for namishu-sudoku 0.1.0
File Size Uploaded Provenance Actions
namishu_sudoku-0.1.0.tar.gz 302.1 kB With provenance Details for namishu_sudoku-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for namishu-sudoku 0.1.0
File Interpreter ABI Platform Actions
namishu_sudoku-0.1.0-py3-none-any.whl Python 3 none any Details for namishu_sudoku-0.1.0-py3-none-any.whl

Total release size: 499.9 kB

Release files / namishu_sudoku-0.1.0.tar.gz

Download URL namishu_sudoku-0.1.0.tar.gz
Size 302.1 kB
Tags Source
SHA-256 checksum
How to use checksums
8adcb301adb0140cb563ffe2c81e73497561e8c24102cf5e37171731ba00bcd4
BLAKE2b-256 checksum
How to use checksums
80932e3a2fc89d1a89441bba7625d1db19d3b0f033ee99a109a0f46f89e0f836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / namishu_sudoku-0.1.0-py3-none-any.whl

Download URL namishu_sudoku-0.1.0-py3-none-any.whl
Size 197.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8774d0617917858554796e6140d13f604c9e15c52b6b2c507b9ab220566aeb80
BLAKE2b-256 checksum
How to use checksums
c66ebe48cbbea19d515dc04fe29622be7f566c8d3df5c608d398c63fe8c7515d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Security for namishu-sudoku 0.1.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for namishu_sudoku-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

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

0.1.0 This release

2 release files Full 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