Skip to main content

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"]}]

Release files for motle 0.2

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

Source distribution (sdist)

Source distribution for motle 0.2
File Size Uploaded
motle-0.2.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for motle 0.2
File Interpreter ABI Platform
motle-0.2-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / motle-0.2.tar.gz

Download URL motle-0.2.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0888f6b697d008dee8f4f060fc4fb4ec3f18f41aeaeecca377888f455e008b43
BLAKE2b-256 checksum
How to use checksums
a41ef7d296ab6849dc2956994d7d1556d8ed0921b05c703f60106b86d0f5d960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / motle-0.2-py3-none-any.whl

Download URL motle-0.2-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62c8d482a243df41c4159f1445533a241b3698a17f14e642d465b49663f86073
BLAKE2b-256 checksum
How to use checksums
0e316f82883640cda9e6514a38c975a5884efa63ee5097ed6a6b2f53000d4f62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files

0.1

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