mando
mando copied to clipboard
Comparision to Click
I came across this wrapper recently and I am willing to know that how this is different the Click. Can you please provide some feature comparison ?
The biggest thing for me is that mando parses the docstring for metadata of the command, including help. With Click you have to repeat the help strings from the docstring.
I think Click also does that see: http://click.pocoo.org/5/documentation/
For Click you have to REPEAT the help you have in the docstring into the decorator...
Click
@click.command()
@click.option('--count', default=1, help='number of greetings')
@click.argument('name')
def hello(count, name):
"""This script prints hello NAME COUNT times.
Parameters
----------
name: str
The person's name to print a greeting to.
count: int
number of greetings
"""
for x in range(count):
click.echo('Hello %s!' % name)
Mando
@mando.command(doctype='numpy')
def hello(name, count=1):
"""This script prints hello NAME COUNT times.
Parameters
----------
name: str
The person's name to print a greeting to.
count: int
number of greetings
"""
for x in range(count):
click.echo('Hello %s!' % name)
You can use Mando, Sphinx, Google, or Numpy styled docstrings. Notice that mando parsed the docstring or the argument call itself to find the arguments, keywords, keyword defaults, arguments and keywords types, and all help strings.
I use mando for many of my projects, if you want examples: https://github.com/timcera/tstoolbox https://github.com/timcera/hspfbintoolbox https://github.com/timcera/wdmtoolbox https://github.com/timcera/swmmtoolbox https://github.com/timcera/tsgettoolbox
Okay this looks nice. Can you give any other difference?