dynamic-cli icon indicating copy to clipboard operation
dynamic-cli copied to clipboard

Switch from `argparse` to Typer

Open pybash1 opened this issue 3 years ago • 6 comments

🚀 Feature

Use Typer instead of argparse

Have you read the Contributing Guidelines on Pull Requests?

Yes

Motivation

I have made applications using both Typer and argparse, and the developer and user experience with Typer is far better in my opinion.

Pitch

This feature reduces a lot of code and also uses modern features like decorators for sub-command handlers, etc. It is cross platform. It will reduce code complexity, allowing new and beginner programmers to contribute.

pybash1 avatar Apr 06 '22 16:04 pybash1

Hi👋 thanks for creating your first issue for IOSF, Will get back to you soon !.

github-actions[bot] avatar Apr 06 '22 16:04 github-actions[bot]

@pybash1 Thanks for your wonderful advice. Can you show me some of the packages which uses this thing ? we need more clarity before moving to any parser. cc @pranavbaburaj @PradyumnaKrishna @peb-peb

GouravSardana avatar Apr 06 '22 16:04 GouravSardana

@GouravSardana It's hard for me to remember an example right now, but if I can remember any, I will let you know.

pybash1 avatar Apr 07 '22 04:04 pybash1

I played around with Typer and it's a wonderful tool, but refactoring and moving from argparse to Typer is a negative from my side. Because even if we refactor the code, it would not change anything major and add to the dependency of the project.

Typer does bring a method for autocompletion in the terminal itself, but it's not the kind of autocomplete that we're looking for (we're looking for the TAB completion style of autocompletion).

But, in it's defense, I would say that it's really beginner-friendly, easy to implement, and has many awesome features.

@GouravSardana @pranavbaburaj what's your opinion on this?

peb-peb avatar Apr 08 '22 14:04 peb-peb

I would be totally fine with porting to typer, if everyone's happy with the decision.

lainq avatar Apr 08 '22 15:04 lainq

We're not in favour of moving from argparser to Typer.

cc @pranavbaburaj

GouravSardana avatar Apr 18 '22 10:04 GouravSardana