Python package for quickly generating structured web application templates for FastAPI and Flask frameworks
Project description
Templatrix
A powerful Python package for quickly generating structured web application templates for FastAPI and Flask frameworks.
Overview
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
Installation
pip install templatrix
Requirements
- Python 3.12 or higher
- Dependencies will be installed automatically:
- FastAPI
- Flask
- uvicorn
- python-dotenv
- pytest
- httpx
Usage
Basic Command Structure
templatrix [framework] [options]
Available Frameworks
fastapi- Generate a FastAPI project structureflask- Generate a Flask project structure
Options
--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
Examples
# 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 --override
Project Structures
FastAPI Structure
Basic Structure
project-directory/
├── .env.example
├── main.py
├── db/
│ └── __init__.py
├── models/
│ └── __init__.py
├── routes/
│ └── __init__.py
├── tests/
│ └── __init__.py
└── utils/
└── __init__.py
Template Structure
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
Flask Structure
Basic Structure
project-directory/
├── .env.example
├── run.py
├── app/
│ ├── __init__.py
│ ├── routes/
│ │ └── __init__.py
│ ├── static/
│ │ └── style.css
│ └── templates/
│ └── index.html
Template Structure
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
Development
Setting up a development environment
- 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]"
Running tests
pytest
Contributing
Contributions 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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
- SaiDhinakar - GitHub Profile
Acknowledgments
- FastAPI - https://fastapi.tiangolo.com/
- Flask - https://flask.palletsprojects.com/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file templatrix-0.1.1.tar.gz.
File metadata
- Download URL: templatrix-0.1.1.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06e9c247b31bd7394fa807603f045a9afcad1c29579e0002d726a179dd85d94b
|
|
| MD5 |
81663d753c8852e6cfdfc4b08e041b0f
|
|
| BLAKE2b-256 |
56f5719faf6c85504d7dbe04d6b29a7c54e0fcb2bf854ff647b116c462b1e8cc
|
File details
Details for the file templatrix-0.1.1-py3-none-any.whl.
File metadata
- Download URL: templatrix-0.1.1-py3-none-any.whl
- Upload date:
- Size: 38.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4256d69c9c0b8528b302189f5d851406429715817fcde277f2f52329b18e225
|
|
| MD5 |
a10931e6949fab39fb63ca30da118f26
|
|
| BLAKE2b-256 |
2d0553735333c47fdc3b1fad5de217e472cf1996d824e107b73acd208ffef163
|