python library for user input
From the accepted answer to this question: the cmd
library might be of interest to you.
"The Cmd class provides a simple framework for writing line-oriented command interpreters."
This Python Module of the Week page features it, and it has some examples and explanations.
This question is quite old, but I'm researching it today. The library pyinputplus is recommended by Al Swigert in Automate the Boring Stuff With Python