Skip to content
Discussion options

You must be logged in to vote

What’s the recommended way to structure a medium-sized Python project (modules/packages)?

A medium-sized Python project should be organized so it’s easy to navigate, test, extend, and package. The common, proven approach today is the “src layout + clear separation of concerns.”

project-name/
│
├── src/
│ └── project_name/
│ ├── init.py
│ ├── main.py # Entry point
│ │
│ ├── config/ # Settings, env handling
│ │ └── settings.py
│ │
│ ├── models/ # Data models / schemas
│ │ └── user.py
│ │
│ ├── services/ # Core business logic
│ │ └── chatbot.py
│ │
│ ├── routes/ # API routes (Flask/FastAPI)
│ │ └── chat_routes.py
│ │
│ ├── utils/ # Helper functions
│ │ └── helpers.py
│ │
│ └── core/ # Shar…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sudoUgando
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants