What is the python alternative to Thor for building self-documenting command line utilities?
UPDATE: The click is the closest equivalent of Thor for python, see http://click.pocoo.org/
Python offers natively (via standard library) two packages to create auto-documenting interfaces for command line tools: optparse and argparse.
The docs says that optparse
is deprecated and argparse
replaces it, maintaining some backward compatibility where possible. Though, argparse is not so easy to use and 3rd-party libraries have been created.
Have a look at docopt and the video about it. cliff is another possibility.
To write line-oriented command interpreters you can find useful the Python cmd module.
I finally want to point out that docopt and cliff are not the Python alternative/s as you asked, but just the couple I found.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With