A minimal Python project boilerplate with modern tooling setup.
- 🛠️ Modern development tools (black, isort, ruff, mypy)
- 📦 Simple dependency management
- 🧪 Testing setup with pytest
- 🔧 Environment variable support
- 🎨 Rich console output
- ✨ VSCode integration with auto-formatting
- 📋 Comprehensive coding standards (see
.cursorrules
)
- Python 3.8+
- Make (optional, for using Makefile commands)
- VSCode (recommended)
- Clone the repository:
git clone https://github.com/abuusama/python-boilerplate.git
cd python-boilerplate
- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install the package with development dependencies:
make install # or: uv pip install -e ".[dev]"
- Copy the sample environment file:
cp .env.sample .env
- Edit
.env
with your configuration:
ENV=development
DEBUG=true
The project includes several scripts for common development tasks:
# Install dependencies
make install
# Format code
make format
# Run linting checks
make lint
# Run tests
make test
# Run the application
make run
# Clean build artifacts
make clean
You can also run the tools directly:
# Format code with black
python -m black src tests
# Sort imports with isort
python -m isort src tests
# Lint with ruff
python -m ruff check src tests
# Type check with mypy
python -m mypy src tests
# Run tests with pytest
python -m pytest tests -v
# Run the application
python -m src.main
The project includes a Makefile with common development tasks:
make install
: Install the package and development dependenciesmake format
: Format code with black and isortmake lint
: Run all linting checks (ruff, black, isort, mypy)make test
: Run tests with pytestmake run
: Run the main applicationmake clean
: Clean up build artifacts and cache files
python-boilerplate/
├── src/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ └── console.py
├── tests/
│ ├── __init__.py
│ ├── test_main.py
│ ├── test_config.py
│ └── test_console.py
├── .vscode/
│ ├── settings.json
│ └── extensions.json
├── .env.sample
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
└── pyproject.toml
This project is licensed under the MIT License - see the LICENSE file for details.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add some amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request