3 ms·
The `click` library would be a nice replacement to `argparse`
by bradwood 4y ago
The `click` library would be a nice replacement to `argparse`
- BerislavLopac 4y agoWhich is fine when building a complex CLI tool which requires other external libraries; but otherwise the compexity of argparse is simply not significant enough to justify the cost of adding external dependencies.
- vladsanchez 4y ago"Click" and "DocOpt" are the 'argparse' replacements. They're the most semantic and intuitive way of developing command-line apps.
- vladsanchez 4y agoThanks for sharing Typer, I was completely oblivious! > Typer uses Click internally. That's the only dependency. Pretty clever way to walk on giants shoulders!
- Hasnep 4y agoI've found Typer [1] pretty intuitive to integrate with existing code, it uses type hints to generate the CLI arguments. [1] https://typer.tiangolo.com/ https://typer.tiangolo.com/
- agons 4y agoI find `typer` way more ergonomic than either argparse or click (which it uses under the hood). If you're developing something more complex, you might find the feature set too small, but you can get surprisingly far with what's there. The benefits from its type safety and lack of boilerplate alone are enough to keep me using it in favour of anything else.