Motle is a library for finding words in wordle game
Project description
Motle
Work in progress
Motle is a library that allows you to search for words based on a dictionary by filtering various criteria.
For now I only have the French scrabble dictionary (OD_8)
How to install
pip install motle
How to use it
from motle import motle
mot = motle.Motle()
mot.count
>> 411430
mot = motle.Motle(length=5)
mot.count
>> 7980
mot.words
>> [{"word": "ABACA", "nb_letters": 5, "spelling": ["A", "B", "A", "C", "A"], "with": ["A", "B", "C"], "without": ["D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]}, ..., {"word": "CARRE", "nb_letters": 5, "spelling": ["C", "A", "R", "R", "E"], "with": ["A", "C", "E", "R"], "without": ["B", "D", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "S", "T", "U", "V", "W", "X", "Y", "Z"]}]
# words with letter R
mot.filter(wth=['R'])
mot.words
>> [{"word": "CARRE", "nb_letters": 5, "spelling": ["C", "A", "R", "R", "E"], "with": ["A", "C", "E", "R"], "without": ["B", "D", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "S", "T", "U", "V", "W", "X", "Y", "Z"]}]
mot.count
>> 1
mot._reset()
mot.count
>> 7980
# words without letter A
mot.filter(wthot=['A'])
mot.words
>> []
# words containing following letters in the order
mot._reset()
mot.filter(contains=['A','B','','',''])
mot.words
>> [{"word": "ABACA", "nb_letters": 5, "spelling": ["A", "B", "A", "C", "A"], "with": ["A", "B", "C"], "without": ["D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]}]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
motle-0.2.tar.gz
(4.7 kB
view hashes)
Built Distribution
motle-0.2-py3-none-any.whl
(5.7 kB
view hashes)