Skip to main content

Select, generate and play always-unique crosswords.

Project description

crossword_puzzle

crossword banner licence PyPI version Publish to PyPI.org release issues CodeQL Tests

An educational GUI/web package built with CustomTkinter and Flask that allows you to design and play procedurally generated crosswords.

Dependencies

Babel customtkinter Flask flask_babel Pillow regex platformdirs pathvalidate CTkToolTip

pycairo is an optional dependency that is required if you want to make PDFs from your generated crosswords. After reading Installation and installing the package, also run pip install pycairo. If you are on an operating system other than Windows, please also read pycairo's Getting Started to install the required headers for pycairo.

[!WARNING]
Languages whose alphabets use complex glyphs (such as Mandarin and Japanese) are not supported when making PDFs.

Tested Python versions

  • Windows: Python >= 3.7
  • MacOS: Python >= 3.8
  • Linux: Python >= 3.8

Requirements

  • Hardware

    • RAM: >120MB (GUI only), >500MB (GUI and browser to play crossword)
    • CPU: Any
    • Storage: >30MB available space (the program and its dependencies)
  • Software

    • OS: Windows, MacOS, Linux
    • Browser: Not Internet Explorer
    • Additional: Python and pip (see Installation)

Limitations

  • Right-to-left scripts are not supported.
  • Translations are made with a translation API, and therefore might be inaccurate.
  • Generated crosswords may occasionally have a few missing words.
  • If your OS scaling is higher than the default, the web application will likely be too big. Read Troubleshooting for more information.

Installation

[!IMPORTANT] Installing crossword_puzzle requires Python3 and pip. If you have Python3 installed without pip, click here to install it.

If you do not have Python3 installed, download the installer here, or install it with pyenv (recommended). Then, refer to the previous link on how to install pip.

Linux and MacOS users: You may not have Tkinter installed by default. Try running sudo apt-get install python3-tk on Linux or sudo pip install python3-tk on MacOS if this is the case.

[!TIP] If using python or pip doesn't work, try using python3 or pip3.

  1. Make a virtual environment and activate it (recommended):
pip install virtualenv
python -m venv venv
MacOS/Unix: source venv/bin/activate
Windows: venv\scripts\activate

Windows users: If you cannot activate the virtual environment, try running Set-ExecutionPolicy Unrestricted -Scope Process in your terminal, ensuring you follow all the prompts. Then, try this step again.

  1. Install the package in your system directory/virtual environment:
pip install crossword-puzzle

or, install the package in your home directory if you aren't using a virtual environment:

pip install --user crossword-puzzle
  1. Install pycairo if you want to make PDFs from your generated crosswords (read Dependencies for more information):
pip install pycairo
  1. Initialise the GUI through the entry point:
crossword-ctk

or, run the package manually through the terminal (requires Git):

git clone https://github.com/tomasvana10/crossword_puzzle.git
cd crossword_puzzle
pip install -r requirements.txt
>>> import crossword_puzzle as xp
>>> xp.main()
  1. You can deactivate your virtual environment when you are done:
deactivate

Updating

  1. Activate your virtual environment if you are using one.

  2. Update the package:

pip install -U crossword-puzzle

Quickstart

You can utilise one of two scripts to quickly activate a virtual environment and update and start crossword_puzzle.

  1. Read the Important section of Installation to install Python3 and pip
  2. Windows users: Ensure you have script execution enabled. If you are unsure, run Set-ExecutionPolicy Unrestricted -Scope Process in your terminal and follow the prompts.
  3. Download a quickstart file from the repository:
  4. Run the script:
    • Windows: Double click the script file or call it in command-line with .\path\to\quickstart-win.bat.
    • MacOS/Linux: Call the script in the command-line with source path/to/quickstart-posix.sh.

Documentation

Check out the wiki here for information on usage, troubleshooting, FAQ, and more.

Third-party library acknowledgements

  • Flask - Web framework for the crossword web application
  • Babel - l10n functionality and management of message catalogues
  • flask-babel - i18n integration for the Flask web application
  • CustomTkinter - Creation of the main GUI
  • platformdirs - Retrieving paths to platform-specific directories
  • Google.Cloud.Translation.V2 - Translation of locales
  • Pillow - Image processing services
  • regex - Alternative to the standard re module, required for some functionality
  • Zoomooz.js - jQuery library for making webpage elements zoomable
  • gulp.js - Toolkit to help automate the web app's JavaScript transpilation
  • Babel.js - JavaScript transpiler
  • Terser - JavaScript minifier
  • CTkToolTip - Tooltips for forms in the crossword editor
  • pathvalidate - Validating crossword name input
  • platformdirs - Storing config and user-made crosswords
  • Pycairo - Crossword PDF creation
  • pywebview - Browser webview to play crossword

Other acknowledgements

Gallery

crossword puzzle home
crossword puzzle browser
crossword puzzle editor
crossword puzzle game english
crossword puzzle game japanese

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crossword_puzzle-2.2.94.tar.gz (4.1 MB view hashes)

Uploaded Source

Built Distribution

crossword_puzzle-2.2.94-py3-none-any.whl (6.2 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page