Like yourself I started doing cli utilities at work and they've become life savers, and I've learned tons while doing them and also getting user feedback from coworkers is nice for ux.
Two questions for you:
Do you use cookiecutter?
How do you like click?
The reason I ask is that I am so used to using argparse, but might give click a try later on.
Cookiecutter gives you quick prompts and generates the whole skeleton for cli app, in less than a couple of minutes you'll have a full directory with files like readme, license, setup.py, etc. It also generates a click.py file if you choose 1 on the click prompt, but I don't use it for the time being since I do it through argparse :) I wonder if I can change the prompts to generate an argparse driven py file instead, onto stackoverflow lol.
Click makes you save a lot of time by using decorators : @click.command()
@click.option('--parameter', '-p', help='your parameter')
def myfunction(myparameter):
print(myparameter)
I'll stop here not to spoil @wangonya
's article 😉
Still great topic!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am doing a similar series though not entirely the same.
dev.to/kodaman2/part-1-introductio...
Like yourself I started doing cli utilities at work and they've become life savers, and I've learned tons while doing them and also getting user feedback from coworkers is nice for ux.
Two questions for you:
The reason I ask is that I am so used to using argparse, but might give click a try later on.
Hey! Your series looks interesting. I'll be following along :)
Cookiecutter gives you quick prompts and generates the whole skeleton for cli app, in less than a couple of minutes you'll have a full directory with files like readme, license, setup.py, etc. It also generates a click.py file if you choose 1 on the click prompt, but I don't use it for the time being since I do it through argparse :) I wonder if I can change the prompts to generate an argparse driven py file instead, onto stackoverflow lol.
Thanks for the feedback on click.
I'll definitely try it out. Thanks for the tip!
Click makes you save a lot of time by using decorators :
@click.command()
@click.option('--parameter', '-p', help='your parameter')
def myfunction(myparameter):
print(myparameter)
I'll stop here not to spoil @wangonya 's article 😉
Still great topic!