I'm currently working on a project that I am structuring in the following manner:
.
├── example_app
│ ├── __init__.py
│ ├── app.py
│ ├── requirements.txt
│ └── classes
│ ├── ExampleClass1.py
│ ├── ExampleClass2.py
│ ├── __init__.py
└── tests
└── test_app.py
Inside of classes/__init__.py I have defined a base class for all of the other "ExampleClasses" to inherit from. Then, inside of app.py I need to import all of these classes. However, this becomes very verbose, as I have to type:
from example_app.classes.ExampleClass1 import ExampleClass1
from example_app.classes.ExampleClass2 import ExampleClass2
...
Is there a way to structure this in a better way? Ideally I would like to keep each class in a separate file as they are not really similar to each other. I thought of importing all the classes inside of classes/__init.py but that does not seem right.
Note that although I only pictured 2 example classes there could be several (tens) of them so importing by hand is quite cumbersome and brittle.
ExampleClass*.py) has the classes of the same names?