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

I have such mixed feelings about Click; I've reached the point of using it so much that I now hate it. Which I think probably means that it's great but only as as stopgap until you learn how to bend argparse to your will. It's just too magic, too much global state, and too much spooky action at a distance.


I actually don't think Click is too much global state and spookiness, at least in relation to a lot of popular Python libraries.

I do wish I could hook into it to test better, the only thing you can really do right now is to have it print stuff out and assert the output string. It's not really necessary to just build a CLI with click, but I want to build a library that integrates with it and testing the integration is a PITA.

I want to write a config-loading library for CLI apps like Golang's Viper lib, but for Python



I went the opposite way. Used to do everything with argparse, then discovered click and never looked back. While argparse lets you do anything, click forces you to build a good CLI.


Click inherits the eternal argparse limitation of "you can't stick --verbose everywhere", doesn't it?


I had the same feeling. I wish there were an equivalent that tried to minimize the magic and global state a bit while still letting you make decent CLIs with a tiny amount of code.




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

Search: