Python Study Here are some tips for the best Python project folder structure:
Make a root folder for your project and give it a meaningful name Within the root, create separate folders for: src - This will contain all your .py source code files tests - This will contain your test scripts and files docs - For documentation like README.md data - For any data files your code needs logs - For log files that get generated config - For any configuration/settings files notebooks - For Jupyter or Colab notebooks related to the project Use lowercase letters and underscores for folder names Try to modularize your code, so have separate folders for different modules/packages Have a main.py in src that ties everything together as the entry point Use relative imports like from .submodule import foo within packages Have an outer LICENSE, README, requirements.txt at the project root Use .gitignore to avoid committing temporary files Consider using a src/ directory or namespace packages for larger projects
The key points:
src contains all source code organized into modules tests contains test scripts notebooks for any Jupyter notebooks docs for documentation data and logs are also useful folders Top level files like requirements.txt and LICENSE Overall clean and modular structure This can serve as a template for most small to medium Python projects.