Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It seems to me that there are a few projects similar this. Here is another, https://pypi.python.org/pypi/Cogs/ (conceptualized as a "Makefile" replacement).

I'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?



Yeah, plenty:

- Cliff http://cliff.readthedocs.org/en/latest/

- docopt http://docopt.org

- argparse

- optparse

etc etc etc...


And the author acknowledges that:

"There are many alternatives to click and you can have a look at them if you enjoy them better. The obvious ones are optparse and argparse from the standard library.

click is actually implemented as a wrapper around optparse and does not implement any parsing itself. The reason it’s not based on argparse is that argparse‘s design does not allow proper nesting of commands by design and has some deficiencies when it comes to POSIX compliant argument handling."

What I love about Pocoo is they always have stellar documentation and give clear rationale - from the beginning.


Does that mean optparse will be maintained along with click? optparse has been deprecated in favor of argparse since 2.7/3.2.


Given that argparse has known problems and that not all optparse code can be ported to argparse I doubt optparse will ever go away. It's also a very small module and if optparse will ever disappear only a subset of optparse is needed to make click work.


There's also Clint by Kenneth Reitz (https://github.com/kennethreitz/clint)


Clint is a cmd tool not parsing tool


And if you can't do it with docopt maybe you are doing it wrong.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: