Project Structure#
Depending on which options you selected, your project initially consists of the following files and folders:
docs/examples/minimal/
├── .copier-answers.yml
├── .github
│ └── workflows
│ └── ci.yaml
├── .gitignore
├── CHANGELOG.md
├── Makefile
├── README.md
├── pyproject.toml
├── src
│ └── sample_project
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── package_data.dat
│ └── simple.py
└── tests
├── test_cli.py
└── test_simple.py
6 directories, 14 files
docs/examples/default/
├── .copier-answers.yml
├── .github
│ └── workflows
│ └── ci.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── CHANGELOG.md
├── Makefile
├── README.md
├── docs
│ ├── index.md
│ ├── macros.py
│ ├── reference.md
│ └── requirements.txt
├── mkdocs.yml
├── pyproject.toml
├── src
│ └── sample_project
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── package_data.dat
│ └── simple.py
└── tests
├── test_cli.py
└── test_simple.py
7 directories, 20 files
docs/examples/full/
├── .bumpversion.cfg
├── .copier-answers.yml
├── .github
│ └── workflows
│ └── ci.yaml
├── .gitignore
├── .pre-commit-config.yaml
├── CHANGELOG.md
├── Makefile
├── README.md
├── docs
│ ├── index.md
│ ├── macros.py
│ ├── reference.md
│ └── requirements.txt
├── mkdocs.yml
├── pyproject.toml
├── src
│ └── sample_project
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ ├── package_data.dat
│ └── simple.py
└── tests
├── test_cli.py
└── test_simple.py
7 directories, 21 files
Python-specific files#
The Python project structure consists of the following elements
docs/examples/default/
├── pyproject.toml
├── src
│ └── sample_project
│ ├── __init__.py
│ ├── __main__.py
│ ├── cli.py
│ └── simple.py
└── tests
├── test_cli.py
└── test_simple.py
pyproject.toml: The main responsibility of this file is to declare the build system needed to build your Python package ([build-system]) as well as package metadata (in the[project]section). However, many Python tools support reading their configuration from this file. These sections are prefixed by[tool.*]src: folder that contains Python packages (folders that contain at least an__init__.pyfile) and modules (files ending in.py)tests: folder that contains tests of your Python code
While other structures are possible, this one has proven itself (and it also the one suggested by the Python Packaging Authority in their Python Packaging User Guide and corresponding sample project). Modern Python packaging tools, like setuptools, will recognize this convention and require no further configuration.