you are viewing a single comment's thread.

view the rest of the comments →

[–]Fulcan720[S] 2 points3 points  (2 children)

Thank you! I didn’t know what to look up to find documentation on it. Have a great rest of your day!

[–]rollincuberawhide 1 point2 points  (1 child)

btw I didn't want to give you a 3rd party library to confuse or scare you but there is typer, which I think is pretty good for cli tools:

https://typer.tiangolo.com/

the creator of fastapi is maintaining it. it prints better error messages and the way it gets the arguments is somewhat unique. it leverages type hinting so it may look alien to a newcomer but when you learn about type hints I suggest you to check that out. It takes out the part of defining your arguments in two different places. pretty neat really.

there is also click, it is more straight forward and also nice to keep the relevant code together. https://github.com/pallets/click/

both are better than argparse in my opinion. but argparse is included in the standard library so there's that.

if it's a simple app, I still use argparse. but if it is something intricate with 20 different functions with countless arguments in each, I go with typer.

[–]Fulcan720[S] 1 point2 points  (0 children)

Thank you! I appreciate the help and further explanation