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
🌐
Real Python
realpython.com β€Ί ref β€Ί best-practices β€Ί project-layout
project layout | Python Best Practices – Real Python
A reference guide to common Python application layouts and project structures for command-line applications, web applications, and more. ... Have a question about this? Mentor AI can show you examples, compare related terms, and point you to tutorials. ... Pick a question and Mentor AI takes it from here. ... By Leodanis Pozo Ramos β€’ Updated Sept. 21, 2026 β€’ Reviewed by Martin Breuss ... Get a Python Cheat Sheet (PDF) and learn the basics of Python, like working with data types, dictionaries, lists, and Python functions:
🌐
The Hitchhiker's Guide to Python
docs.python-guide.org β€Ί writing β€Ί structure
Structuring Your Project β€” The Hitchhiker's Guide to Python
Thanks to the way imports and modules are handled in Python, it is relatively easy to structure a Python project. Easy, here, means that you do not have many constraints and that the module importing model is easy to grasp.
Discussions

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 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
Out of curiosity: what is the python project structure you usually go gor?
The usual result I get is the big ball of mud . More on reddit.com
🌐 r/Python
86
95
April 18, 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
🌐
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?
🌐
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):
🌐
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/.
🌐
Real Python
realpython.com β€Ί python-application-layouts
Python Project Structure: How to Choose the Right Layout – Real Python
2 hours ago - The patterns you’ve seen so far come together in complete Python project structures. The examples below walk from a library to a CLI, through the major web frameworks, and on to a GUI app.
Find elsewhere
🌐
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 β”‚ β”‚ β”œβ”€β”€ ...
🌐
Read the Docs
app.readthedocs.org β€Ί projects β€Ί python-project β€Ί downloads β€Ί pdf β€Ί latest pdf
Python Project Documentation Release 1.0 Tim Diels Jan 10, 2018
Python Project is a collection of Python project templates, checklists and documentation of their associated workflow. Currently, the collection contains just one project structure.
🌐
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.
🌐
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.
🌐
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.
🌐
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.
🌐
Coderwall
coderwall.com β€Ί p β€Ί lt2kew β€Ί python-creating-your-project-structure
Python: Creating Your Project Structure (Example)
August 26, 2025 - The Example Application for this text can be found in github.com/mrako/python-example-project. ... 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 ...
🌐
GitHub
gist.github.com β€Ί ericmjl β€Ί 27e50331f24db3e8f957d1fe7bbbe510
How to organize your Python data science project Β· GitHub
I have a lesson learned from multiple months of working with other people that led me to this somewhat complicated, but hopefully ultimately useful directory structure. Under this folder called projectname/, we put in a lightweight Python package called projectname that has all things that are refactored out of notebooks to keep them clean. It has an __init__.py underneath it so that we can import functions and variables into our notebooks and scripts: ... In projectname/projectname/config.py, we place in special paths and variables that are used across the project. An example might be:
🌐
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 - Once you have installed all the packages that your project needs, you can run: ... pip freeze is "freezing" all the packages/versions currently being used. Then you are piping (i.e., saving) the output of pip freeze via a txt file. ... You've heard that creating tests for your code is a good idea. So you're writing Python code and trying to test it with Pytest. Example: Let's say you create a file called greetings.py and another one to write some tests called test_greetings.py.
🌐
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 ... 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 β”‚ └── ...