Doesn't too much matter. Whatever makes you happy will work. There aren't a lot of silly rules because Python projects can be simple.

  • /scripts or /bin for that kind of command-line interface stuff
  • /tests for your tests
  • /lib for your C-language libraries
  • /doc for most documentation
  • /apidoc for the Epydoc-generated API docs.

And the top-level directory can contain README's, Config's and whatnot.

The hard choice is whether or not to use a /src tree. Python doesn't have a distinction between /src, /lib, and /bin like Java or C has.

Since a top-level /src directory is seen by some as meaningless, your top-level directory can be the top-level architecture of your application.

  • /foo
  • /bar
  • /baz

I recommend putting all of this under the "name-of-my-product" directory. So, if you're writing an application named quux, the directory that contains all this stuff is named /quux.

Another project's PYTHONPATH, then, can include /path/to/quux/foo to reuse the QUUX.foo module.

In my case, since I use Komodo Edit, my IDE cuft is a single .KPF file. I actually put that in the top-level /quux directory, and omit adding it to SVN.

Answer from S.Lott on Stack Overflow
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org β€Ί writing β€Ί structure
Structuring Your Project β€” The Hitchhiker's Guide to Python
Ravioli code is more likely in Python: it consists of hundreds of similar little pieces of logic, often classes or objects, without proper structure. If you never can remember, if you have to use FurnitureTable, AssetTable or Table, or even TableNew for your task at hand, then you might be swimming in ravioli code. Python modules are one of the main abstraction layers available and probably the most natural one. Abstraction layers allow separating code into parts holding related data and functionality. For example, a layer of a project can handle interfacing with user actions, while another would handle low-level manipulation of data.
Discussions

Describe python "project" structure
Would it be possible for somebody very briefly describe what each folder in python file structure does ? I can deduct that β€œsrc” contains source files… What I do not get is - what contains GUI (windows) _ and what contains code which does processing and why. More on discuss.python.org
🌐 discuss.python.org
19
0
July 4, 2023
What is the optimal structure for a Python project?
3 tips from me: When you use typing everywhere then you are forcing yourself to omit the circular dependencies (we cannot have circular dependencies imports in python) between modules which is the easiest way to keep a very basic structure. Think of the modules hierarchy while structuring the python code. Which module is high level (e.g. dashboard, GUI) and which is low level (e.g. some utils module build upon a standard library). Always import a module that has a lower level of abstraction (or in other words, lower complexity) in the module with higher complexity. E.g. GUI module imports storage access module and not the other way around. More on reddit.com
🌐 r/Python
52
253
December 25, 2023
Python project structure
Hello, I am a programmer with experience in multiple of programming languages, but not yet in python. I want to start a bigger project, but while googling I find a lot of conflicting advice on how to structure it. Can someone provide me a few links to what’s the standard today, if there even ... More on discuss.python.org
🌐 discuss.python.org
6
1
October 13, 2023
What’s your approach to organizing Python projects for readability and scalability?
Read software engineering books. The more clean code, design patterns knowledge you have the better. One thing I do is to look at scikit learn source code. It’s very well coded you learn a lot from it. I simply mimic their file and architectural structure. More on reddit.com
🌐 r/Python
29
41
July 1, 2025
🌐
Real Python
realpython.com β€Ί ref β€Ί best-practices β€Ί project-layout
project layout | Python Best Practices – Real Python
When laying out Python projects, ... that describe and configure the project: pyproject.toml, README.md, LICENSE, and configuration files for tools and continuous integration (CI)....
🌐
Python.org
discuss.python.org β€Ί python help
Describe python "project" structure - Python Help - Discussions on Python.org
July 4, 2023 - Would it be possible for somebody very briefly describe what each folder in python file structure does ? I can deduct that β€œsrc” contains source files… What I do not get is - what contains GUI (windows) _ and what contains code which does processing and why.
🌐
Coderwall
coderwall.com β€Ί p β€Ί lt2kew β€Ί python-creating-your-project-structure
Python: Creating Your Project Structure (Example)
August 26, 2025 - ... In my experience the best folder structure for a Python project is to put your executables in a bin folder and your project into a your project name folder (I will use name project in this text).
🌐
GitHub
github.com β€Ί nedbat β€Ί pkgsample
GitHub - nedbat/pkgsample: A simple example of how to structure a Python project Β· GitHub
Perhaps you need to support more versions (choose a lower requirement) or you want to use some newer Python features (choose a higher requirement). Comments throughout the files, especially in pyproject.toml show where to make these choices, and link to resources that can help. This repo is a demonstration of making a distributable package. You should examine the files here, decide which are right for you, and adapt them to your needs. This directory is where you put your code. It should have one subdirectory named for your project, and all of your work goes into that subdirectory.
🌐
Medium
medium.com β€Ί @adityaghadge99 β€Ί python-project-structure-why-the-src-layout-beats-flat-folders-and-how-to-use-my-free-template-808844d16f35
Python Project Structure: Why the β€˜src’ Layout Beats Flat Folders (and How to Use My Free Template) | by Aditya Ghadge | Medium
May 17, 2025 - This layout isn’t magic, but it’s been β€œjust structured enough” for everything from tiny utilities to multi-service RAG pipelines. Copy it, tweak it, and you’ll spend more time coding features β€” less time chasing folders. A tidy tree is great, but without the right automation glue it’s easy to slip back into chaos. Here are the four guard-rails baked into the template repo (check them out live in the workflow files and configs at Adityag009/python-project-template):
Find elsewhere
🌐
Python By Night
pythonbynight.com β€Ί blog β€Ί starting-python-project
Organizing and Structuring Your Python Project
July 11, 2022 - I briefly wrote about this before, but I want to reiterate here. In almost every case, you want to ensure you have a virtual environment created for your project. Using python -m venv .venv (or python3 -m venv .venv if you're on a Mac) should do the trick.
🌐
Real Python
realpython.com β€Ί python-application-layouts
Python Application Layouts: A Reference – Real Python
April 23, 2026 - While you read this reference guide, keep in mind that the exact location of the files in the layout matters less than the reason they are placed where they are. All of these files should be in a project directory named after your project. For this example, we will use (what else?) helloworld as the project name and root directory. Here’s the Python project structure I typically use for a CLI app:
🌐
Cosmicpython
cosmicpython.com β€Ί book β€Ί appendix_project_structure
Appendix B: A Template Project Structure
All the source code for our app, including the domain model, the Flask app, and infrastructure code, lives in a Python package inside src,[3] which we install using pip install -e and the setup.py file. This makes imports easy. Currently, the structure within this module is totally flat, but for a more complex project, you’d expect to grow a folder hierarchy that includes domain_model/, infrastructure/, services/, and api/.
🌐
Wpcomstaging
waterprogramming.wpcomstaging.com β€Ί 2023 β€Ί 01 β€Ί 18 β€Ί structuring-a-python-project-recommendations-and-a-template-example
Structuring a Python Project: Recommendations and a Template Example – Water Programming: A Collaborative Research Blog
January 18, 2023 - Here, I present a recommended structure for new Python projects, and discuss the main components. This is largely targeted at Python users who have not had a formal Python training, or who are working with their first significantly sized project. I provide an example_python_project, hosted on GitHub, as a demonstration and to serve as a template for beginners.
🌐
Away With Ideas
awaywithideas.com β€Ί the-optimal-python-project-structure
The optimal python project structure | Away With Ideas
March 21, 2020 - Since the source code is the most important part of our project, let’s start by adding a package to our project structure. The package needs to contain at least an __init__.py file. This tells python that this directory is indeed a package. When python loads this package, it automatically runs the __init__.py.
🌐
Dagster
dagster.io β€Ί blog β€Ί python-project-best-practices
How to Structure Python Projects
March 21, 2023 - Properly organizing your code is crucial when working on a Python project. You can start by creating separate folders for different parts of the project, such as one for the code itself, one for data, one for testing, and one for project documentation. This way to structure will help you find what you need more quickly and make it easier for others to navigate your code.
🌐
GitHub
github.com β€Ί csymvoul β€Ί python-structure-template
GitHub - csymvoul/python-structure-template: A Python project to use as a template when developing a Python application Β· GitHub
A python project to use as a template when developing a Python application. project β”œβ”€β”€ README.md β”œβ”€β”€ example β”‚ β”œβ”€β”€ __init__.py β”‚ β”œβ”€β”€ package_1 β”‚ β”‚ β”œβ”€β”€ __init__.py β”‚ β”‚ β”œβ”€β”€ awesome_module.py β”‚ β”‚ β”œβ”€β”€ ...
🌐
DEV Community
dev.to β€Ί codemouse92 β€Ί dead-simple-python-project-structure-and-imports-38c6
Python Package Structure: Dead Simple Python: Project Structure and Imports - DEV Community
April 27, 2022 - Executable projects should have a __main__.py in the top-level package. Then, you can directly execute that package with python -m myproject. Of course, there are a lot more advanced concepts and tricks we can employ in structuring a Python project, but we won't be discussing that here.
🌐
Python.org
discuss.python.org β€Ί python help
Python project structure - Python Help - Discussions on Python.org
October 13, 2023 - Hello, I am a programmer with experience in multiple of programming languages, but not yet in python. I want to start a bigger project, but while googling I find a lot of conflicting advice on how to structure it. Can someone provide me a few links to what’s the standard today, if there even is 1 standard?
🌐
Towards Data Science
towardsdatascience.com β€Ί home β€Ί programming β€Ί the good way to structure a python project
The Good way to structure a Python Project | Towards Data Science
February 9, 2022 - In order to keep your project space running, it's a good idea to create a virtual environment and keep your dependencies isolated. You can use the venv module of Python and specify the Python version and the environment name. In the example below, I am using Python3 and calling the environment venv.
🌐
GitHub
github.com β€Ί yngvem β€Ί python-project-structure
GitHub - yngvem/python-project-structure: An outdated tutorial on how to manage a Python project Β· GitHub
In this part of the tutorial, I hope to show you a way to initate any Python project to ensure that you won't have to do major effort restructuring the code once you want to publish it. Let us start with the folder layout. Your project directory should be structured in the following way and we will explain why later. project_name β”œβ”€β”€ docs β”‚ β”œβ”€β”€ make.bat β”‚ β”œβ”€β”€ Makefile β”‚ └── source β”‚ β”œβ”€β”€ conf.py β”‚ └── index.rst β”œβ”€β”€ examples β”‚ └── example.py β”œβ”€β”€ src β”‚ └── package_name β”‚ └── __init__.py β”œβ”€β”€ tests β”‚ └── __init__.py β”œβ”€β”€ .gitignore β”œβ”€β”€ LICENSE.txt β”œβ”€β”€ MANIFEST.in β”œβ”€β”€ README.rst β”œβ”€β”€ requirements.txt β”œβ”€β”€ setup.cfg β”œβ”€β”€ setup.py └── tox.ini
🌐
YouTube
youtube.com β€Ί watch
Basic Project Structure for a Python App - YouTube
AGENTIC CODING CLUB [ ⚑ my official community ]β–Ί https://www.skool.com/zazencodes-agentic-coding-club-7823⚑ Weekly code-with-me sessions to ask questions⚑ Fu...
Published: May 2, 2024