Python Project Template
π A comprehensive Python project template designed to help developers quickly bootstrap new projects with complete CI/CD pipelines, modern tooling, and best practices.
The template includes everything needed to start a professional Python project without spending time on infrastructure setup.
Other Languages: English | δΈζ
Why Use This Template?
This template eliminates the time-consuming setup of project infrastructure, allowing you to focus on building your application. It provides:
- Zero-configuration CI/CD: Complete GitHub Actions workflows out of the box
- Modern Python tooling: Latest best practices with uv, ruff, and pytest
- Professional development environment: VS Code Dev Container with optimized terminal setup
- Comprehensive documentation: Auto-generated docs with MkDocs Material
- Quality assurance: Pre-commit hooks, testing, and coverage reporting
π― Key Features
Modern Development Stack
- Python 3.10, 3.11, 3.12 support with uv dependency management
- Ruff for ultra-fast linting and formatting
- pytest with coverage reporting and parallel execution
- Pre-commit hooks for automated code quality checks
Complete CI/CD Pipeline
- Automated testing across multiple Python versions
- Code quality gates with ruff validation
- GitHub Pages deployment for documentation
- Release automation with semantic versioning
- Auto-labeling for pull requests
Production-Ready Infrastructure
- Docker support with multi-stage builds
- VS Code Dev Container with zsh, oh-my-zsh, and powerlevel10k
- MkDocs documentation with Material theme
- Makefile commands for common development tasks
Intelligent Automation
- Project initialization script (
scripts/initpyrepo.go
) for personalized setup - Documentation generation (
scripts/gen_docs.py
) from code and notebooks - Auto-generated API docs from Python code
- Blog functionality for project updates
π Getting Started
Quick Setup Options
- Click Use this template
- Configure your new repository
- Clone and start developing
# Clone the repository
git clone https://github.com/Mai0313/mcp_agents.git
cd mcp_agents
# Replace with your project name (snake_case)
find . -type f -name "*.py" -o -name "*.md" -o -name "*.toml" | xargs sed -i 's/mcp_agents/your_project_name/g'
# Replace with your project title (PascalCase)
find . -type f -name "*.py" -o -name "*.md" -o -name "*.toml" | xargs sed -i 's/MCPAgents/YourProjectTitle/g'
# Install and setup
make uv-install && uv sync && make format
Development Workflow
# Run tests
make test
# Format code
make format
# Generate documentation
make gen-docs
# Clean artifacts
make clean
π Project Structure
The template follows Python packaging best practices with a clean, organized structure:
βββ .devcontainer/ # VS Code Dev Container setup
β βββ Dockerfile # Development environment
β βββ devcontainer.json # VS Code configuration
βββ .github/
β βββ workflows/ # CI/CD pipelines
β β βββ test.yml # Multi-version testing
β β βββ code-quality-check.yml
β β βββ deploy.yml # Documentation deployment
β β βββ release_drafter.yml
β βββ copilot-instructions.md
βββ docker/
β βββ Dockerfile # Production container
β βββ docker-compose.yaml
βββ docs/ # MkDocs documentation
β βββ index.md
β βββ installation/
β βββ blog/
βββ scripts/ # Automation tools
β βββ initpyrepo.go # Project initialization
β βββ gen_docs.py # Documentation generation
βββ src/
β βββ mcp_agents/ # Main package
βββ tests/ # Test suite
βββ pyproject.toml # Project configuration
βββ .pre-commit-config.yaml
βββ Makefile # Development commands
βββ README.md
π§ Configuration Files
The template includes comprehensive configuration for:
pyproject.toml
: Project metadata, dependencies, and tool configurations.pre-commit-config.yaml
: Code quality hooks with ruffpytest
configuration: Testing, coverage, and reporting setupmkdocs.yml
: Documentation generation and deployment- Docker configurations: Development and production containers
π¨ Customization
Project Name Customization
This template is designed for quick customization through simple global replacements:
- Replace package name: Change all instances of
mcp_agents
to your project name (recommended: snake_case) - Replace project title: Change all instances of
MCPAgents
to your project title (recommended: PascalCase) - Update metadata: Modify author, description, and other details in
pyproject.toml
Example commands:
# If your project is called "awesome_project"
find . -type f -name "*.py" -o -name "*.md" -o -name "*.toml" | xargs sed -i 's/mcp_agents/awesome_project/g'
find . -type f -name "*.py" -o -name "*.md" -o -name "*.toml" | xargs sed -i 's/MCPAgents/AwesomeProject/g'
Dependency Management
# Add production dependencies
uv add requests pydantic
# Add development dependencies
uv add pytest black --dev
# Update all dependencies
uv sync
Documentation
The template uses MkDocs with Material theme and supports:
- Auto-generated API docs from Python docstrings
- Jupyter notebook integration with automatic conversion
- Blog functionality for project updates
- Custom themes and styling
CI/CD Customization
All workflows are modular and can be customized:
- Testing matrix: Modify Python versions in
.github/workflows/test.yml
- Code quality: Adjust ruff rules in
pyproject.toml
- Documentation: Configure MkDocs deployment in
.github/workflows/deploy.yml
- Release process: Customize release drafting and versioning
π’ Enterprise Features
Security & Compliance
- Dependency scanning with automated updates
- Security linting with bandit integration
- License compliance tracking
- Secrets management best practices
Team Development
- Standardized development environment with Dev Containers
- Code review automation with quality gates
- Consistent coding standards enforced by pre-commit hooks
- Documentation requirements for all public APIs
π Success Stories
This template has been used to bootstrap:
- Machine Learning projects with GPU support
- Web APIs with FastAPI and async support
- Data processing pipelines with scientific computing stack
- CLI tools with modern Python packaging
π Learn More
- Installation Guide - Detailed setup instructions
- Development Workflow - Best practices for development
- CI/CD Configuration - Understanding the automation
- Customization Guide - Adapting for your needs
π€ Contributing
We welcome contributions! Whether it's:
- π Bug reports and fixes
- β¨ Feature requests and implementations
- π Documentation improvements
- π¨ Template enhancements
See our Contributing Guide for details.
π₯ Contributors
Made with contrib.rocks
Ready to start your next Python project? Use this template and focus on building amazing applications! π