Re:Don't write command-line interfaces (and how to write if ...
by xtiansimon on Tuesday October 13, 2020 @03:14PM
(#24769104)
> "Any system worth keeping around should be a library (or family of libraries)..."
I'm interested to read more about this topic.
I maintain about 8-10 Python Click CLI scripts (a la 'Practical Business Python') which are basically clones of 2-3 original scripts. These have worked really well for me (developing them) and for the handful of colleagues who I share them with.
This summer I started a project to put a Flask front end on a few of the CLI scripts.
Reading the OP I started to imagine the decorator-on-function from `typer` might be an interesting way to maintain functions for the Flask App to call and still preserve the CLI functionality.
Then again, and I'm a neophyte here, I assume a 'library' formalization would give me both options as well...
I'm interested to read more about this topic.
I maintain about 8-10 Python Click CLI scripts (a la 'Practical Business Python') which are basically clones of 2-3 original scripts. These have worked really well for me (developing them) and for the handful of colleagues who I share them with.
This summer I started a project to put a Flask front end on a few of the CLI scripts.
Reading the OP I started to imagine the decorator-on-function from `typer` might be an interesting way to maintain functions for the Flask App to call and still preserve the CLI functionality.
Then again, and I'm a neophyte here, I assume a 'library' formalization would give me both options as well...