Creating CLIs in Python with Click
HTML-код
- Опубликовано: 13 сен 2024
- Click is a significantly more powerful and versatile alternative to the built-in argparse which makes it incredibly to create command-line interfaces in Python!
-
If you enjoy my content, consider supporting me on Patreon or becoming a member!
patreon.carber...
join.carberra.xyz
If you need help with anything, feel free to join the Discord server:
discord.carber...
I get a lot of people asking, so here's my Visual Studio Code setup!
• My Visual Studio Code ...
-
If you have any questions, don't hesitate to ask in the comments! I'll try and answer as soon as I can, providing someone else hasn't already done so.
#python #coding #howto
Just wanted to note something I forgot to mention in the video: if you want to set a help message for any arguments or options, you can pass `help="message"`! Wasn't worth re-recording the whole thing for, but thought I'd mention it (:
This is a great video, thank you. I think I will definitely use this over argparse
I had terrible time with click's context: invoking subcommands. Click promises to handle arguments validation but doesn't do so for subcommand invocation with leads to reimplementation of entire validation logic and question "why would you use click in this case?". Since than I'm using argparse every single time, because you should type just a bit more but it is way more maintainable code.
Seems like a great library! Very handy. I don't like the decorator stacking, though. It tickles my OCD, probably. One decorator is fine, two is pushing it, three or more is just foul.
Really missing comparison to the built in argparse library and why use click over argparse
wow, i wasted many hours, thx for the tool👌👌
Yeah I tried to do some crazy stuff with argparse once and just using click is so much easier lmao
🤔🤔🤔