Sample project used to demo refactoring a CLI tool for an elegant UX and improved DX and robustness.
See tag unrefactored
for the bad, original version, and branch main
for the refactored, improved version.
# Clone
git clone https://github.com/camball/python-cli-demo
cd python-cli-demo/
# Install Globally
pip3 install .
echo "\n\nexport PATH=\"\$PATH:$HOME/Library/Python/3.12/bin\"" >> ~/.zshrc
wordinfo define <words>... [--language <language_code>]
wordinfo plural <word>
wordinfo indefinite <noun>
wordinfo ordinal <number>
wordinfo (-h | --help)
Due to an upstream bug in the Free Dictionary API, the only language codes that work (when passed to wordinfo define <word> --language <language code>
) are the following:
en
en_US
en_GB
Technically there are many other supported languages, but they don't seem to work.
- The wonderful
inflect
library - The Free Dictionary API