The biggest gripe I have with using Python for rich command-line tool is the startup time. One of the first reason I like to write a nice command-line tool when I start a project, say foo, is to be able to do `foo --help` to quickly see and remember what the project can do (I have a very bad memory and doing this makes it possible for me to jump back faster to a project, even well documented. I can forget what I was…
Click – Python library for command-line interfaces
21–30 of 105 posts
Re: Click – Python library for command-line interfaces
#22Looks like a nice wrapper around argparse: https://docs.python.org/3/library/argparse.html
It's a wrapper around optparse, as per http://click.pocoo.org/why/ . I'm curious about that decision given that optparse is deprecated. It says it's because argparse doesn't allow nested commands, but I don't really see why that feature is so desirable as to warrant using a deprecated module. I probably need to have a play with it to find out. Looks like a nice module.
argparse requires the parser to have full knowledge of everything which makes it slow if you add many commands. Biggest problem though is that it's parsing system is a bit broken when it comes to escaping. Options with arguments cannot have values starting with dashes which is problematic for delegating subcommands to other things.
For what I wrote Click for I could not find any alternatives that worked that way besides optparse itself but that is hard to use.
Re: Click – Python library for command-line interfaces
#23Re: Click – Python library for command-line interfaces
#24Gorgeous. This guy has a full time job, a wife, and wrote Flask and Werkzeug, ItsDangerous, Sphinx, Markupsafe, Jinja2 (and Jinja) and that's just some of the well known stuff. Handsome and young too. Bastard. He probably saves the world in a dinner jacket in his spare time.
Re: Click – Python library for command-line interfaces
#25It looks really well done. I still prefer docopt ( https://github.com/docopt/docopt ) . It is so much simpler to use. Click seems to be a bit overengineered.
docopt is much simpler because it's only capable of creating very trivial interfaces. That's perfectly fine if that's all what you want to do but it also makes docopt unusable, if that's not the case.
Re: Click – Python library for command-line interfaces
#26Gorgeous. This guy has a full time job, a wife, and wrote Flask and Werkzeug, ItsDangerous, Sphinx, Markupsafe, Jinja2 (and Jinja) and that's just some of the well known stuff. Handsome and young too. Bastard. He probably saves the world in a dinner jacket in his spare time.
Sphinx was written by Georg Brandl, not by Armin Ronacher.
Re: Click – Python library for command-line interfaces
#27Ahh.. I really like pocoo's products. But I've found manage.py ( https://github.com/Birdback/manage.py ) to be far leaner and simple. What do you guys think?
Re: Click – Python library for command-line interfaces
#28Re: Click – Python library for command-line interfaces
#29Re: Click – Python library for command-line interfaces
#30I'm wondering if there could be a breakout at the next PyCon to see if we could discuss approaches and come up with a unified way to do convert Python libraries into command line scripts?