Python one class per module and packages
Question: I'm trying to structure my app in Python. Coming back from C#/Java background,
I like the approach of one class per file. I'd like my project tree to look
like this:

    
    
    [Service]
        [Database]
            DbClass1.py
            DbClass2.py
        [Model]
            DbModel1.py
            DbModel2.py
        TheService.py
    [ServiceTests]
        [Database]
            DbClass1Tests.py
            DbClass2Tests.py
        [Model]
            DbModel1Tests.py
            DbModel2Tests.py
        TheServiceTests.py
    

  1. Is the one class per file approach OK in Python?
  2. Is it possible to create packages/modules in such a way so that packages work like Java's packages or .NET's namespaces, i.e. in DbModel1Tests.py:
    
        import Service.Model
    
    def test():
       m = DbModel1()
    


Answer: Q1. You can use the 1 class per file style in Python, but this is unusual.

Q2. you'd have to use `from Service.Model import *` and do some stuff in
`Service/Model/__init__.py` which is generally frowned upon. Avoid `import *`
in Python

My personal advice on this: Python is _not_ C#/Java. Trying to bend it to make
it look like $other_language will cause frustration and poor user experience.

Keep in mind that:

  * you can have other stuff than classes in Python modules (functions, for instance)
  * you don't have to import a class from a module unless you need to instantiate that class. Especially, if your code only uses instances of DbModel1 which are passed as arguments to your functions / methods, there is no need for the import in that part of the code
  * from `Service.Model.DbModel1 import DbModel1` looks bad. Prefer `from service.model import DbModel1` : avoid uppercase letters in file names and directory names, and group classes / functions logically in files (rather than grouping them in directories as you would do with the 1 class per file system.) 

