A powerful Python package for quickly generating structured web application templates for FastAPI and Flask frameworks.
Templatrix provides an intuitive command-line interface for scaffolding new web application projects with best practices already implemented. It offers two template options for each supported framework:
- Basic Structure - A minimal, clean project structure with essential files and directories
- Complete Template - A comprehensive application template with example models, routes, authentication, and more
pip install templatrix- Python 3.12 or higher
- Dependencies will be installed automatically:
- FastAPI
- Flask
- uvicorn
- python-dotenv
- pytest
- httpx
templatrix [framework] [options]fastapi- Generate a FastAPI project structureflask- Generate a Flask project structure
--path PATH- Specify a custom project directory (defaults to current directory)--override- Override existing directory if it exists--template- Use a fully featured template with example code--vcs- Initialize git repository with appropriate .gitignore
# Create a basic FastAPI project in the current directory
templatrix fastapi
# Create a complete Flask template in a custom directory
templatrix flask --path ./my-flask-app --template
# Create a FastAPI project with git initialization
templatrix fastapi --vcs
# Create a Flask project overriding any existing directory
templatrix flask --overrideproject-directory/
├── .env.example
├── main.py
├── db/
│ └── __init__.py
├── models/
│ └── __init__.py
├── routes/
│ └── __init__.py
├── tests/
│ └── __init__.py
└── utils/
└── __init__.py
The template option includes a complete application structure with:
- User model and database setup
- Authentication routes
- Health check endpoints
- Configuration utilities
- Database utilities
- Example tests
project-directory/
├── .env.example
├── run.py
├── app/
│ ├── __init__.py
│ ├── routes/
│ │ └── __init__.py
│ ├── static/
│ │ └── style.css
│ └── templates/
│ └── index.html
The template option includes a complete application structure with:
- User model and database setup
- Authentication system
- Multiple route examples
- Static assets (CSS/JS)
- HTML templates
- Example tests
- Clone the repository:
git clone https://github.com/SaiDhinakar/templatrix.git
cd templatrix- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: .\venv\Scripts\activate- Install development dependencies:
pip install -e ".[dev]"pytestContributions are welcome! Please feel free to submit a Pull Request.
- 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
This project is licensed under the MIT License - see the LICENSE file for details.
- SaiDhinakar - GitHub Profile
- FastAPI - https://fastapi.tiangolo.com/
- Flask - https://flask.palletsprojects.com/