I used to write my (simple) Python programs in Python 2, but it seems that Python 3 is quite mature. I now have a CLI program called ratjuice.py and when I execute it the program asks for a command input (which I have made some tab completion thing for).
So I might have commands like html which could output the subcommands like parse or destroy. I might want to use the command html parse rat.html. So I am looking for a Python module which allows me to parse this input based on a white list. So I would basically tell what is allowed and the rest is ignored or rejected (I might forget some things if I sanitize the input...)
Is there any good way to do this other than mere string manipulation?