4 ms·
I read this entire thread thinking - this is neat and all but it’s a handful of lines of almost english language in a .py file. Click is a neat upgrade from ar
by CraigJPerry 6y ago
I read this entire thread thinking - this is neat and all but it’s a handful of lines of almost english language in a .py file.
Click is a neat upgrade from argparse if you’re ever tempted (assuming something like “pip install —-user” is viable in your situation which isn’t true for everyone).
I’ve seen, but haven’t used https://typer.tiangolo.com/ https://typer.tiangolo.com/ - i have used his FastAPI and thought that was nicely done (even if python async is a bit annoying to test).
Talking of python cli libs I haven’t tried but will do one day - rich: https://github.com/willmcgugan/rich https://github.com/willmcgugan/rich
- verdverm 6y agoI try to avoid pip and dependencies for these python scripts. This goal has it's limits. Click is nice if you want a command with multiple sub commands. I use Go + Cobra at that point via https://github.com/hofstadter-io/hofmod-cli https://github.com/hofstadter-io/hofmod-cli The human understanding is a big reason why python has gained my favor over bash
- p_l 6y agoWell, but then you'd be writing python. (and having to maintain python runtime environment, which tends to be much less stable than CL)