Skip to main content
https://img.shields.io/pypi/v/python-wordle?color=success Documentation Status Python Version Support GitHub Issues GitHub Followers Twitter Followers

Wordle – Game, Solver and Helper!

Features

  • Comprehensive CLI Application
    • Play Wordle in your terminal!

    • Let the solver play it out for you!

    • Use the helper mode for solving Wordles provided by other platforms!

  • New Wordle every day.
    • Disclaimer: This has nothing to do with the NYTimes Wordle.

  • Play more using --random option.

  • Reproducible random Wordle by specifying --seed.

  • WordleSolver() class for solving Wordle.

  • --solve option to let WordleSolver() do its work in front of your eyes!

  • --helper option to activate the helper mode for help with solving Wordles provided by other platforms.

Install

To install, run this command in your terminal:

$ pip install python-wordle

Usage

usage: wordle [-h] [--random] [--seed SEED] [--solve] [--helper]

Wordle on your terminal

optional arguments:
-h, --help   show this help message and exit
--random     Show a random Wordle
--seed SEED  Seed the RNG
--solve      Simulate WordleSolver
--helper     Take help from WordleSolver for a Wordle in a different platform

Example

screenshot.png

Helper Session

Attempt 1
=========

Suggestions: [('kioea', 95.7343887423043)]
Chosen word: aeons
Obtained result: 01201
Eliminated 15868 options.

Attempt 2
=========

Suggestions: [('thrip', 78.0), ('thirl', 78.0)]
Chosen word: thrip
Obtained result: 00000
Eliminated 39 options.

Attempt 3
=========

Suggestions: [('blayk', 72.72727272727273), ('milky', 72.72727272727273), ('bulky', 72.72727272727273), ('lucky', 72.72727272727273), ('mckay', 72.72727272727273)]
Chosen word: milky
Obtained result: 10020
Eliminated 10 options.

Attempt 4
=========

Valid Words: {'smoke'}
Suggestions: [('smoke', 0.0)]
Chosen word: smoke
Obtained result: 22222

Congratulations!

Terminology

All of the following terms are valid in the context of a specific Wordle.

  • A set of known letters is a set of letters which are known to be present in the Wordle’s word based on clues obtained from the previous attempts.

  • A set of valid words at any given point refers to a set of words from vocabulary that are possible solutions to the Wordle at that point based on the clues obtained till then.

  • A letter is said to cover a word if the letter belongs to that word.

  • Coverage (absolute) of a word refers to the percentage of valid words (at that point) covered by the letters in that word.

  • Coverage (relative) of a word refers to the percentage of valid words (at that point) covered by the set of

Solver

Solver roughly uses the following strategy,

  • Guess a word with highest (relative) coverage.

  • After each guess, eliminate words based on the clues, e.g.,
    • Remove all words that contain an incorrect-letter

    • Remove all words that do not contain the identified (correct-letter, correct-position) combinations

    • Remove all words that contain the identified (correct-letter, incorrect-position) combinations

    • Remove all words that do not contain a correct-letter

    • Re-calculate (relative) coverage and guess again

  • If at any point, number of valid words drops below number of attempts left, guess the valid words one-by-one.

  • Additionally, there are heuristics to choose a word if multiple words with best coverage-score exist.

Helper

Helper mode can be used to get assistance while solving Wordle from another provider.

  • Suggestions for words will be provided at each step.

  • You may choose a word and obtain result.

  • Enter the obtained result as a ternary string, i.e., a string made of 0, 1, and 2.
    • 0 : (grey) : an incorrect letter.

    • 1 : (yellow) : a correct letter in wrong position.

    • 2 : (green) : a correct letter in correct position.

  • e.g., if the third letter turned green and fifth letter turned yellow in the third party Wordle, then you should input 00201 as the result obtained.

Evaluation

WordleSolver has been evaluated on the entire vocabulary.

Setup

  • Word Size: 5

  • Vocabulary Size: 15918

  • Maximum Attempts: 6

Performance

  • Success Count: 15446

  • Success Rate: 97.03 %

  • Average Attempts: 4.58

History

0.1.0 (2022-02-28)

  • First release on PyPI.

Metadata

Release files for python-wordle 0.1.4

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

Source distribution (sdist)

Source distribution for python-wordle 0.1.4
File Size Uploaded
python-wordle-0.1.4.tar.gz 1.9 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-wordle 0.1.4
File Interpreter ABI Platform
python_wordle-0.1.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 3.6 MB

Release files / python-wordle-0.1.4.tar.gz

Download URL python-wordle-0.1.4.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
094e91f0101f7cd6372aab78b5dae80472a288da8dc3f4a5c184ccc7c1721a78
BLAKE2b-256 checksum
How to use checksums
017422d93462f03aa5350ab57a9024a049a48f5df119c881c285f3d68bb7428c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

Release files / python_wordle-0.1.4-py2.py3-none-any.whl

Download URL python_wordle-0.1.4-py2.py3-none-any.whl
Size 1.8 MB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
2d60ab2f48ddd5144dc646dbdba46ee59beb9e7bf9801b6f8f38b080b8a230fb
BLAKE2b-256 checksum
How to use checksums
f772ac977e5dfcdaad9e20766f7d5fe89d766eecca53941a595a1fab215d2c30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.5.0.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.11

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

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