Project Structure
Create Python App generates a simple, practical project structure designed to help you start development immediately.
A typical generated project looks like:
my-python-app/├── .venv/├── pyproject.toml├── README.md├── src/│ ├── __init__.py│ └── app.py├── tests/│ └── test_sample.py└── docs/ └── README.mdRoot Directory
Section titled “Root Directory”The root directory contains the main project configuration and documentation files.
pyproject.toml
Section titled “pyproject.toml”Contains project metadata and Python package configuration.
Example:
[project]name = "my-python-app"version = "0.1.0"requires-python = ">=3.10"
dependencies = []README.md
Section titled “README.md”The primary documentation file for your project.
Use this to:
- Describe the project.
- Explain installation and usage.
- Document development workflows.
Virtual Environment
Section titled “Virtual Environment”Create Python App automatically creates a Python virtual environment for the project.
The virtual environment helps isolate project dependencies from other Python projects installed on the system.
Typical activation command on Windows:
.venv\Scripts\activateSource Code
Section titled “Source Code”The src directory contains the application’s Python source code.
Example:
src/├── __init__.py└── app.pyapp.py
Section titled “app.py”A simple starter application is generated automatically.
Example:
def main(): print("Hello from your new Python app!")
if __name__ == "__main__": main()Testing
Section titled “Testing”The tests directory contains automated tests.
Example:
tests/└── test_sample.pyA sample test is included to help you get started with automated testing.
Documentation
Section titled “Documentation”The docs directory contains project-specific documentation.
Example:
docs/└── README.mdUse this directory for:
- User guides
- Technical documentation
- Architecture notes
- Development references
Why This Structure?
Section titled “Why This Structure?”The generated structure follows a simple principle:
Keep project files organised, predictable and easy to understand.
The goal is to provide a sensible starting point while remaining flexible enough for projects of any size.
Next Steps
Section titled “Next Steps”After project creation:
- Activate the virtual environment.
- Open the project in your preferred editor.
- Begin development in
src/app.py. - Add tests to the
testsdirectory. - Expand the documentation as the project grows.
