Skip to content

BusterCharlie/TemplateProject

Repository files navigation

TemplateProject

Python Versions License Built with ttkbootstrap

A GUI-based Python project generator for quickly creating new applications with a modern look and feel, powered by ttkbootstrap.

This tool was created to streamline the process of starting a new Python project, especially for simple GUI applications. It sets up a clean project structure, a virtual environment, and includes a theme engine out of the box, so you can focus on building your app's features.

Main window of the TemplateProject generator

Table of Contents

  • Features
  • Prerequisites
  • How to Use
  • The Generated Project
  • Contributing
  • License

Features

  • Easy-to-Use GUI: Configure your new project through a simple and intuitive interface.
  • Comprehensive Project Setup:
    • Define your project's name, description, and output directory.
    • Include author information (name and email) which is automatically added to the pyproject.toml and LICENSE files.
  • Customization:
    • Icon Support: Automatically convert an image (.png, .jpg, etc.) into a .ico file for your application's icon.
    • Theme Engine: Select from various light and dark themes from ttkbootstrap. The generated project includes the same theme selection capability, and remembers your choice.
  • Technical Foundation:
    • Python Version: Choose the target Python version for your project (supports 3.9 - 3.12).
    • Virtual Environment: Automatically creates a Python virtual environment using uv for fast and reliable dependency management.
    • Git Initialization: Initializes a new Git repository in your project folder by default (this can be disabled).
  • Complete Project Template:
    • A well-organized directory structure.
    • pyproject.toml pre-configured with necessary dependencies like ttkbootstrap.
    • A professional README.md template.
    • Cross-platform run scripts (run.bat for Windows, run.sh for Unix-like systems).
    • Standard .gitignore and LICENSE files.
  • Configuration Persistence: All settings, including output path, author info, and theme selection, are saved to a local config file. Your preferences are remembered for the next time you run the generator.

How to Use

  1. Run the TemplateProject application using run.bat on Windows or run.sh on Unix-like systems.

  2. On the Home tab, fill in your project details:

    • Project Name: A name for your project (e.g., MyCoolApp). It's best to use a name that is friendly for folder and repository naming.
    • Project Description: A short description for your README.md.
    • Project Directory: The parent folder where your new project folder will be created.
    • Icon Path (Optional): Path to an image to use as the app icon.
    • Author Name & Email (Optional): For the pyproject.toml and LICENSE files.
  3. Switch to the Settings tab to configure the environment:

    • Select the desired Python Version.
    • Toggle Initialize Git Repository if needed.
    • You can also change the theme of the generator app itself.
    Settings tab of the TemplateProject generator showing theme and Python version options
  4. Click Generate Project. A confirmation will appear once it's done.

    A small confirmation dialog showing the project was generated successfully
  5. That's it! Your new project is ready for you to start coding.

The Generated Project

Your new project is created with a clean, ready-to-use structure. It includes a sample application window with "Home" and "Settings" tabs.

  • The Home tab is where you'll add your application's main functionality.
  • The Settings tab comes with the same theme selector, allowing users of your app to change its appearance. The chosen theme is saved and reapplied on the next launch.
The home tab of a newly generated application
The settings tab of a newly generated application showing the theme selector

Prerequisites

  • Python 3.9 or newer.
  • An active internet connection is required for the first run to download the necessary dependencies.
  • The provided run scripts handle the automatic installation of uv and other packages into a local virtual environment.

Project Structure

TemplateProject/
├── src/template_project/     # Main application source
│   ├── generators/           # Template processing and project generation
│   ├── gui/                 # User interface components
│   └── templates/           # Jinja2 templates for generated projects
├── docs/                    # Project documentation and implementation notes
│   ├── README.md           # Documentation index
│   └── *.md                # Implementation summaries and history
├── dev/                     # Development and testing files
│   ├── README.md           # Development folder documentation
│   └── test_*.py           # Test scripts (excluded from distribution)
├── run.bat / run.sh        # Cross-platform startup scripts
└── pyproject.toml          # Project configuration

The project follows standard Python project organization:

  • docs/ - Implementation documentation and project history
  • dev/ - Development utilities and tests (excluded from distribution)

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines on how to contribute to this project.

License

This project is licensed under the MIT License. The generated projects also include an MIT License by default.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published