I have several modules in one package (a kind of a toolkit), which I use in my projects. The structure looks like this:
the_toolkit:
__init__.py
basi
An alternative solution I came up with is to implement a short API class in the __init__ file which can make use of the __all__ variable (which may already be defined for import * purposes). Something like this in __init__.py:
import matrix_kit
class _matrix_kit_API:
def __init__(self):
for func in matrix_kit.__all__:
setattr(self, func, eval(f"matrix_kit.{func}"))
matrix_kit = _matrix_kit_API()