When creating a Python package, the actual top-level command is frequently installed in a PATH folder, such as /usr/local/bin. For it to reference all the related package modules, they need to be explicitly qualified with the package name:
import package.module
and explicitly called
package.module.function(args)
In a big package, with extensive use of argparse, there might be hundreds of references to functions and variables in the package, all of which need to be qualified with the package name when referenced from /usr/local/bin/cmd.py. This is fine for Production use but a pain during development as the package needs to be reinstalled every time a change is tested. (i.e. It can only find modules in that one, explicit location.
And so, finally, to my question:- Can the command itself (/usr/local/bin/cmd.py) be a stub that just imports a module within the package, containing the argparser and its definitions?
Using this method, all the modules (except the stub) live within the package directory and intra-package references will find all the other modules without the need to explicitly state the package name on them.