r/Python • • Mar 21 '18

Please don’t use Click

http://xion.io/post/programming/python-dont-use-click.html
0 Upvotes

7 comments sorted by

6

u/DanCardin Mar 21 '18 edited Mar 21 '18

I feel like a better criticism is that the decorators return a callable which does not act like the function being decorated. This makes testing and composing functions seemingly obnoxious.

I feel like my ideal interface would leverage type annotations and separate there cli registration from definition, maybe something like

def command(name: int, fun: Optional[bool]=None):
    ...

cli.run(
    commands=[command],
)

Edit: I may mean hug

3

u/metaperl Mar 21 '18

That is an impressive library.

2

u/Paddy3118 Mar 21 '18

Docopt "clicks" for me.

3

u/metaperl Mar 21 '18

Not for me. :)

I like Plumbum.

Used to like argh and pyinvoke.

3

u/[deleted] Mar 21 '18

I found click a great tool to wrap python projects. To add migration steps, testing and other stuff related to the project itself.

This is just a click bait without technical fundamentals but only few wrong concept ideas such as "only one purpose"

Go ahead, use click. If it fits your needs, use it, its that simple.

2

u/[deleted] Mar 21 '18

Fri 20 May 2016

Considering I've been using click successfully since before this, I'm gonna go a head and just ignore this.

1

u/cediddi SyntaxError: not a chance Mar 22 '18

I prefer argparse. It's not the easiest in the competition but most extendable for sure.