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

Комментарии • 11

  • @Carberra
    @Carberra  Год назад +2

    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 (:

  • @awesomegamer31
    @awesomegamer31 8 месяцев назад

    This is a great video, thank you. I think I will definitely use this over argparse

  • @RuslanKovtun
    @RuslanKovtun Год назад +1

    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.

  • @willemvdk4886
    @willemvdk4886 Год назад

    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.

  • @auroragb
    @auroragb Год назад

    Really missing comparison to the built in argparse library and why use click over argparse

  • @birdbeakbeardneck3617
    @birdbeakbeardneck3617 Год назад +1

    wow, i wasted many hours, thx for the tool👌👌

    • @Carberra
      @Carberra  Год назад

      Yeah I tried to do some crazy stuff with argparse once and just using click is so much easier lmao

  • @someabsolutelyrandomstuff9440
    @someabsolutelyrandomstuff9440 Год назад

    🤔🤔🤔