Skip to main content

Little helper to play the Wordle game

Project description

Wordle

Description

This is to help playing the Wordle game.

Usage

All the command line options can be found with the --help option.

$ poetry run wordle --help
usage: Propose words for the Wordle game. [-h] [--large] [--stats] [--none] [--unique] [--check] [--verbose] [--letters LETTERS] [--minfrequency MINFREQUENCY]

options:
  -h, --help            show this help message and exit
  --large               Uses the large file of english words.
  --stats               Displays some stats about the found words.
  --none                Use none of the previously used letters.
  --unique              Do not repeat letters in a word.
  --check               Check that the word is valid.
  --verbose             Print progress.
  --letters LETTERS     The set of letters to be used.
  --minfrequency MINFREQUENCY
                        A minimum frequency for the proposed words, between 1 and 7.

Check the Words API

In order to call the Words API below, you need to store a valid Rapid API key in RAPIDAPI_KEY environment variable. This can be done with the secret.sh if available in the repository:

. secret.sh

Using the --check option will check all proposed words with the Words API. Be carefull that we only have 2500 free queries per day. After that it will automatically cost $0.004 per extra word. But it is also quite easy to check the status current of the usage.

poetry run wordle --check

Letters

The --letters is useful to start the game with a word that is using the most common english letters to have the best chances to find letters of the solution word. It also could be a good idea to add the --unique option to avoid repeating a letter. Adding the --check will allow to check how often the words are used. This can be filtered with a --minfrequency. And if you do not add too many letters, you can finally add --all to see the full list of matching words.

poetry run wordle --letters=etaionshr --unique --check --minfrequency=3 --all

Development

The python depedencies are handled with Poetry.

poetry install

Unit tests

This is how to run the unit tests and generate the JUnit report.

poetry run pytest --junitxml=test-reports/report.xml

Check the types

This is done with mypy

poetry run mypy *.py

Check the syntax

This is done with pylint

poetry run pylint *.py

Initial word list

The initial list is taken from Github. But it contains many word that hardly exist. A smaller list was taken from Corncob.

Safety

In order to test that all the dependencies have no known issues, we are experimenting with Safety that compares our dependencies to the Satefty DB.

Checking the safety of the installed packages is done as follow:

poetry run safety check

Poetry makes it easy to upgrade to the latest packages. It will update the poetry.lock and even the pyproject.toml accordingly.

poetry update

Publish to Pypi

On Pypi, this package is called pywordle. It is very simple to publish it with poetry:

poetry install
poetry build
poetry publish

Then it can be used with pip for example:

pip instal pywordle
wordle --help

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

pywordle-0.2.1.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

pywordle-0.2.1-py3-none-any.whl (1.3 MB view details)

Uploaded Python 3

File details

Details for the file pywordle-0.2.1.tar.gz.

File metadata

  • Download URL: pywordle-0.2.1.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1019-aws

File hashes

Hashes for pywordle-0.2.1.tar.gz
Algorithm Hash digest
SHA256 23c8adfe03ccc48042bca8d00e9f2154b39661a3e771f89618e29af7ce09097a
MD5 823cfbc6c62d6561fa85647d7839cae9
BLAKE2b-256 3a28b7ec0b347c18bcb7a2c92e379f8427b1c1d4cbf33ed449e8bdb21cfb69b8

See more details on using hashes here.

File details

Details for the file pywordle-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: pywordle-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.12 CPython/3.10.1 Linux/5.11.0-1019-aws

File hashes

Hashes for pywordle-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f996fc655931c6d92490475499130179626ff9a25943e12d1165917176dbca3e
MD5 eff6034c1157717021408d4aaa59097e
BLAKE2b-256 39793af5eab70aa26ed9641d104bf1b51e9ff16c975855887483041796d8ec5d

See more details on using hashes here.

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