This Python project automates the generation of sudoku puzzle books in PDF format, complete with solutions.
It utilizes code from RutledgePaulV/sudoku-generator to generate the sudoku puzzles themselves, and then formats them into pages before concatenating them into a single PDF document.
-
The sudoku generator algorithm from RutledgePaulV's repository is utilized to generate a given amount of puzzles and solutions, storing them as text files.
-
The generated puzzles are formatted into 1800×2700px (6×9" 300 dpi) PNG images for pages.
-
The formatted puzzles and solutions are then combined into a single PDF file.
To use this sudoku book generator, you can follow these steps:
-
Clone the repository:
git clone https://github.com/anna-st-40/sudoku-book-generator
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the Python script to generate your Sudoku book:
python main.py
-
The script will ask the number of each difficulty level desired, then will generate the puzzles, pages, and final PDF. These will be in a folder in the same directory as your cloned repository, and will be named according to the time that you ran the script, according to the following convention:
sudoku_YYYYMMDDHHMMSS
- Refactor: PdfMerger is deprecated and will be removed in pypdf 5.0.0. Use PdfWriter instead.
- Change font sizes and line widths to look nicer