i have a third party package which looks like this:
packagename
├── subfolder1
| ├── Someclass11.py
| ├── ...
| └── __init__.py <- EMPTY
├── subfolder2
| ├── Someclass21.py
| ├── ...
| └── __init__.py <- EMPTY
├── Someclass1.py
├── Someclass2.py
├── ...
└── __init__.py
packagename/__init__.py
looks like this:
from packagename.subfolder1.Someclass11 import Someclass11
from packagename.subfolder2.Someclass21 import Someclass21
from packagename.Someclass1 import Someclass1
from packagename.Someclass2 import Someclass2
My own Project has this structure:
projectname
├── thirdParty
| ├── packagename
| └── ...
├── subfolder2
| └── ...
├── ...
└── main.py
I want to include the Classes from packagename
in my main.py
(and in other classes/functions).
This works if I change the packagename/__init__.py
to:
from projectname.thirdParty.packagename.subfolder1.Someclass11 import Someclass11
from projectname.thirdParty.packagename.subfolder2.Someclass21 import Someclass21
from projectname.thirdParty.packagename.Someclass1 import Someclass1
from projectname.thirdParty.packagename.Someclass2 import Someclass2
Are there solutions to import packagename
without editing packagename/__init__.py
and having other functions import it from different locations?