Python Forum

Full Version: Whether to create a separate package for command line support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am writing some software which I call XML Boiler. I have xmlboiler.core for core functionality of my package. In some (far) future, I may also add xmlboiler.http or xmlboiler.proxy for a proxy server implementing access the core library through HTTP protocol.

Now I am working on a command line interface to my core library. (The core library is probably unlike to be used directly, but only through the command line and/or HTTP(S) proxy.)

Question: Should I put the main() function (which interprets the command line) inside xmlboiler.core or to create a special package for command line (xmlboiler.command_line)?

Note that currently all support for command line is to be in one file, not (at least yet) into a hierarchy of several packages.

https://github.com/vporton/xml-boiler (currently in debugging).
I would say create a special package. If you are going to have multiple ways to access the core functionality, I would keep the different access methods separate from that functionality. You don't want to bias things towards one access type, so keeping them in separate packages clarifies keeping them separate conceptually.