in reply to Possible to have a module act as a standalone??
What I understand you wanting to do is to have a set of functionality that can return its output in 2 different ways. Ok - have the functions in the module accept a flag that determines what it should do with that data.
Then, you have your CLI thingy do its thing and you have a stand-alone script that does its thing. (The stand-alone script will, most likely, be extremely short, but that's a good thing.)
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.