Skip to main content

Python package for quickly generating structured web application templates for FastAPI and Flask frameworks

Project description

Templatrix

PyPI version Python Version License

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:

  1. Basic Structure - A minimal, clean project structure with essential files and directories
  2. 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 structure
  • flask - 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

  1. Clone the repository:
git clone https://github.com/SaiDhinakar/templatrix.git
cd templatrix
  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: .\venv\Scripts\activate
  1. Install development dependencies:
pip install -e ".[dev]"

Running tests

pytest

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

templatrix-0.1.1.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

templatrix-0.1.1-py3-none-any.whl (38.4 kB view details)

Uploaded Python 3

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

Hashes for templatrix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 06e9c247b31bd7394fa807603f045a9afcad1c29579e0002d726a179dd85d94b
MD5 81663d753c8852e6cfdfc4b08e041b0f
BLAKE2b-256 56f5719faf6c85504d7dbe04d6b29a7c54e0fcb2bf854ff647b116c462b1e8cc

See more details on using hashes here.

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

Hashes for templatrix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4256d69c9c0b8528b302189f5d851406429715817fcde277f2f52329b18e225
MD5 a10931e6949fab39fb63ca30da118f26
BLAKE2b-256 2d0553735333c47fdc3b1fad5de217e472cf1996d824e107b73acd208ffef163

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page