📡 You're offline — showing cached content
New version available!
Quick Access
Tutorials Python from Zero Python Project Structure

Python Project Structure

5 min read
Structure Python projects with src/, tests/, and pyproject.toml. Use black for auto-formatting and ruff for linting. A clear project structure with pre-commit hooks makes collaboration and maintenance much easier.

Project Layout

my_project/
├── src/
│   └── myapp/
│       ├── __init__.py
│       ├── models.py
│       └── utils.py
├── tests/
│   └── test_models.py
├── .env
├── requirements.txt
├── pyproject.toml
└── README.md

Use pyproject.toml with setuptools or poetry for packaging.