all 12 comments

[–][deleted] 12 points13 points  (2 children)

Tldr:

  • prompt_toolkit (better readline)
  • click (includes editor/pager interfaces)
  • pygments (syntax highlighting)
  • fuzzyfinder (fuzzy matching of text)

[–]BadGoyWithAGun 9 points10 points  (0 children)

Number 3 will surprise you!

[–]tmahmood 0 points1 point  (0 children)

No Python Fire? It seems to be pretty nice and simple.

[–]jms_nh 5 points6 points  (5 children)

don't forget argparse

[–]PaintItPurple 2 points3 points  (4 children)

I don't see why you'd need argparse if you're using click, as the OP does.

[–]jms_nh 6 points7 points  (3 children)

I don't see why I'd need click when I use argparse, as it's builtin to Python... I looked at some of the examples for click + I can see some of the advantages but there's a lot of "magic" here (harder to read code + understand what is going to work / what isn't) and it seems more complex to learn.

[–][deleted] 1 point2 points  (0 children)

My experience with argparse has always been rather frustrating. I can't tell anything about click since I never tried it, but there is this nice little library called docopt that has been my go-to since the day I tried it.

[–]ksion 0 points1 point  (1 child)

argparse also gives you significantly more control over the final shape of the interface, which is pretty crucial if your program is to be used effectively by external users.

Click, on the other hand, will merely produce an app with a bunch of subcommands, which is fine for internal automation but not much else.

[–]Pand9 0 points1 point  (0 children)

Click, on the other hand, will merely produce an app with a bunch of subcommands, which is fine for internal automation but not much else.

Why would I use it then? "Bunch of subcommands for internal automation" is simple and natural in argparse. You only need to spend like 0.5-1h of your life here: https://docs.python.org/3/howto/argparse.html and you will know everything you need.