I have the following folder structure of python modules:
allFunctions
├─ import_all.py
├─ __init__.py
├─ funcSetA
├─ __init__.py
│ ├─ funcA1.py
│ └─ funcA2.py
└─ funcSetB
├─ __init__.py
├─ funcB1.py
├─ funcB2.py
└─ funcB3.py
I want to import all the functions to be useable as funcA1()
, or at worst allFunctions.funcA1()
, but explicitly not as allFunctions.funcSetA.funcA1()
. I also want to import the functions using the script import_all.py, not with the top level__init__.py
(other levels are fine). I am not worried about namespace conflicts as the function names are very specific
I tried doing the following:
import allFunctions
from allFunctions import funcSetA as funcSetA
from funcSetA import funcA1
but obviously this doesn't work
I'm running python3.10