Skip to content

camball/python-cli-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python CLI Demo

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.

Installation

# 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

Usage

wordinfo define <words>... [--language <language_code>]
wordinfo plural <word>
wordinfo indefinite <noun>
wordinfo ordinal <number>
wordinfo (-h | --help)

Notes

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.

Credits

About

Sample project used to demo refactoring a CLI tool for an elegant UX and improved DX and robustness.

Resources

Stars

Watchers

Forks

Languages