Skip to main content

Word Cookies helper/solver/answers

Project description

Word Cookies

Word Cookies helper

continuous integration PyPI version fury.io License: MIT codecov

Demo

Demo Demo

Usage

Library

Install the package then

from wordcookies import game
from pprint import pprint

word = "word"
chars = game.clean(word)
answers = game.get_possible_answers(chars)
g = game.group(answers)
pprint(g, width=120)

"""
{2: ['do', 'dr', 'dw', 'od', 'or', 'ow', 'rd', 'ro', 'rw', 'wd', 'wo', 'wr'],
 3: ['dor', 'dow', 'ord', 'owd', 'owr', 'rod', 'row', 'rwd', 'wod', 'wro'],
 4: ['drow', 'word']}
"""

CLI

Install the package then

python -m wordcookies cli
python -m wordcookies cli --word="word"
python -m wordcookies cli --word="word" --exit

Web (Docker)

Install Docker then run the jojoee/wordcookies Docker image by the command below

docker run -p 8082:9001 --name ctn_wordcookies jojoee/wordcookies
curl localhost:8082

Web (Docker Compose)

Install Docker and Docker Compose then

cd ./web
docker-compose -f docker-compose.yaml up

Installation

pip install wordcookies

# or
git clone https://github.com/jojoee/wordcookies
cd wordcookies
python setup.py install

Features

  • [demo] Add cli demo gif
  • [demo] Add web demo gif
  • [ci] setup continuous integration
  • [cd] setup continuous delivery
  • [pypi] Deploy to https://pypi.org/project/wordcookies/
  • [test] Add more test
  • [cli] add Usage section
  • [web][docker] use Python base image instead of current
  • [web][docker] generate dict while building an Docker image
  • [web] add web version
  • [web][docker] add Docker support
  • [web][cache] with file and Redis
  • [web][cache] pre-caching most common word
  • [web] enhance UI
  • [dict] using nltk data is not good enough, so need to combine with "ahmadly/WordCookiesCheat" (you can try with beginner level, some word is missing)
  • [web] add e2e test

Development

conda -V
conda deactivate
conda remove --name wordcookies --all
conda create --name wordcookies python=3.7.5
conda activate wordcookies
python -V
pip list

# lib, dev
pip install -r requirements.txt
PYTHONPATH="$PWD" python wordcookies/cli.py
pip freeze > requirements.txt

# lib, test
conda remove --name wordcookies_test --all
conda create --name wordcookies_test python=3.7.5
conda activate wordcookies_test
pip install -r requirements.txt
python -m flake8 --ignore=E501 wordcookies tests
python -m pytest tests --cov=./ --cov-report=xml
pip install .
python -m wordcookies cli
python -m wordcookies cli --word="word"
python -m wordcookies cli --word="word" --exit

# lib, test pypi
pip install twine # package for publishing
python setup.py sdist bdist_wheel # build the package

# web
cd ./web
conda remove --name wordcookies_web --all
conda create --name wordcookies_web python=3.7.5
conda activate wordcookies_web
pip install -r requirements.txt
uvicorn main:app --reload --port 9002 # dev + hot reload
uvicorn main:app --port 9002 & # dev
python main.py # run on prod

# web, util
lsof -i -n -P | grep 9002
docker run -p 6379:6379 --name ctn_redis -d redis:6.0.8

# web, Cocker
cd ./web
docker build -f Dockerfile -t jojoee/wordcookies:0.0.1 .
docker run -p 8082:9001 --name ctn_wordcookies jojoee/wordcookies:0.0.1
docker run -p 8082:9001 --name ctn_wordcookies jojoee/wordcookies
docker start ctn_wordcookies
http://localhost:8082/healthcheck
http://localhost:8082/404

# web, Docker Compose
docker-compose -f docker-compose.yaml up
docker-compose -f docker-compose.dev.yaml up --build
docker-compose -f docker-compose.dev.yaml up

Reference

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

wordcookies-1.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

wordcookies-1.0.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file wordcookies-1.0.1.tar.gz.

File metadata

  • Download URL: wordcookies-1.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for wordcookies-1.0.1.tar.gz
Algorithm Hash digest
SHA256 feac26dcf5aede8bf5b6573a6aead0c1f0caee22762678471eacb92d5106ed45
MD5 0ded5e19db508e62e885a5eaf7465d04
BLAKE2b-256 86109b086cf1167ab6133aa9efc17de2266418bde8b21ddf21d6b9acd5ffc0ad

See more details on using hashes here.

File details

Details for the file wordcookies-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: wordcookies-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for wordcookies-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 65701fb8b967b010c36898ec4b8aee522cf9feee3325e762d5f5a479c81e3028
MD5 bc4e411a8bbf4762f827d0ff602307f8
BLAKE2b-256 c1f12b96566a5dc1d0ea17e71a458a969f1220334adefbb20337970cac6b132d

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