Problem Statement
Propose a clean Python project layout for a medium service and explain why it scales.
Explanation
Use a src layout with a top-level package for code, and tests as a sibling. Group code by feature or layer: api, core, adapters, and shared utils. Keep entry points thin and route all logic through the core domain layer.
This layout isolates concerns, avoids import path hacks, and lets you publish the package if needed. It also makes testing easy because each module has a clear dependency direction toward the core.
Code Solution
SolutionRead Only
project/
pyproject.toml
src/myapp/{api,core,adapters,utils}
tests/{unit,integration}