Metadata-Version: 2.4
Name: pynagram3
Version: 3.1.0
Summary: Pynagram - Unjumble the letters and get addicted!
Author: Miro Moman
Author-email: Umang Varma <umang.me@gmail.com>
License-Expression: GPL-3.0-or-later
Project-URL: Homepage, https://github.com/mirix/pynagram3
Project-URL: Original, https://launchpad.net/pynagram
Keywords: game,anagram,word,puzzle,qt
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: X11 Applications :: Qt
Classifier: Intended Audience :: End Users/Desktop
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Games/Entertainment :: Puzzle Games
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: COPYING
Requires-Dist: PyQt6>=6.2
Dynamic: license-file

# pynagram3

Pynagram is a simple anagram word game: you get seven jumbled letters and five
minutes to find as many words as you can. Find at least one seven-letter word
and your score carries over to the next round.

Pynagram was originally written by Umang Varma (2009-2011,
<https://launchpad.net/pynagram>) for Python 2 and PyQt4. This fork ports it to
Python 3 and Qt 6 (PyQt6) and packages it so that it can be installed on any
modern Linux distribution.

## Installation

Pynagram is a regular Python package. It needs Python 3.10 or newer; PyQt6 is
pulled in automatically.

### With pipx (recommended)

[pipx](https://pipx.pypa.io) installs applications in their own isolated
environment and puts the `pynagram` command on your `PATH`:

```sh
# Debian / Ubuntu
sudo apt install pipx
# Fedora
sudo dnf install pipx
# Arch
sudo pacman -S python-pipx

pipx ensurepath          # once, then open a new terminal
pipx install pynagram3   # from PyPI
# or straight from GitHub:
pipx install git+https://github.com/mirix/pynagram3
```

`uv tool install pynagram3` works the same way if you use
[uv](https://docs.astral.sh/uv/).

### Add it to your application menu

pip cannot install desktop menu entries, so Pynagram can do it for you
(current user only, under `~/.local/share`):

```sh
pynagram --install-desktop     # adds launcher + icons
pynagram --uninstall-desktop   # removes them again
```

### Inside a virtual environment

```sh
python3 -m venv ~/.venvs/pynagram
~/.venvs/pynagram/bin/pip install pynagram3
~/.venvs/pynagram/bin/pynagram
```

(Modern distributions refuse a plain `pip install --user` with an
*externally-managed-environment* error; use pipx or a venv as above.)

### Arch Linux

A `PKGBUILD` that uses the system `python-pyqt6` is in
[`packaging/arch`](packaging/arch). Build it with `makepkg -si`.

### Troubleshooting

On X11 desktops Qt 6 needs `libxcb-cursor`. If Pynagram fails with
*"Could not load the Qt platform plugin xcb"*, install it:

```sh
sudo apt install libxcb-cursor0     # Debian / Ubuntu
sudo dnf install xcb-util-cursor    # Fedora
sudo pacman -S xcb-util-cursor      # Arch
```

## How to play

| Key            | Action                                  |
|----------------|-----------------------------------------|
| letters        | pick a letter                           |
| Enter          | submit the word                         |
| Backspace      | put the last letter back                |
| Esc            | put all letters back                    |
| Space          | shuffle the letters                     |
| Ctrl+N         | new game                                |
| Ctrl+L         | give up and show the solution           |
| Ctrl+O         | choose a word list                      |
| Ctrl+Q         | quit                                    |

Scores: 3/5/8/14/20 points for 3/4/5/6/7-letter words, a 30-point bonus for
the first seven-letter word and another 30 for finding every word.

### Word lists

The game ships with an English word list derived from SCOWL. Use
*Game → Word Lists* to add your own: plain-text files with one word per line
(any language; words are lower-cased and anything that is not purely letters
is ignored). You can also drag files, or text from an editor, onto the list.
A word list must contain at least one seven-letter word.

Settings live in `~/.config/pynagram/config.json`. A configuration from the old
`~/.pynagram/config.txt` is imported automatically.

## Development

```sh
git clone https://github.com/mirix/pynagram3 && cd pynagram3
python3 -m venv .venv && . .venv/bin/activate
pip install -e . pytest
python -m pynagram      # run from the checkout
pytest                  # run the tests
python -m build         # sdist + wheel in dist/  (pip install build)
```

Releasing to PyPI: bump `__version__` in `pynagram/__init__.py`, tag the commit
`vX.Y.Z` and push the tag; the GitHub workflow builds and uploads it (configure
the project as a *trusted publisher* on PyPI first).

## Changes since the PyQt5 port

- Ported from PyQt5 to PyQt6; installable with pip/pipx (`pyproject.toml`),
  with a `pynagram` command and `python -m pynagram`.
- Word list and icons are bundled inside the package; the built-in list is
  found regardless of where the package is installed.
- Fixed adding word lists from the GUI (the file dialog result was misread) and
  drag & drop of files/text onto the word list.
- Fixed word ordering in the solution grid (shortest first, alphabetical, as in
  the original 1.0).
- Keyboard input uses the typed character, so non-English word lists work.
- Unreadable or unusable word lists are reported instead of crashing; the game
  falls back to the built-in list.
- Configuration follows the XDG standard (`~/.config/pynagram`).
- Desktop launcher and icons via `pynagram --install-desktop`; proper icon on
  Wayland.

## License

GPL-3.0-or-later; see [COPYING](COPYING). The word list is derived from SCOWL,
copyright Kevin Atkinson and others; see
[`pynagram/data/wordlist/README`](pynagram/data/wordlist/README).
