No description
Find a file
2025-06-30 17:55:43 +02:00
config Restructure project to use modular architecture 2025-04-25 18:04:10 +02:00
src Changed(core): format with Black Formatter 2025-06-30 17:55:43 +02:00
templates Restructure project to use modular architecture 2025-04-25 18:04:10 +02:00
.gitignore Restructure project to use modular architecture 2025-04-25 18:04:10 +02:00
app.py Changed(core): format with Black Formatter 2025-06-30 17:55:43 +02:00
LICENSE init 2025-04-13 00:37:20 +02:00
README.md Restructure project to use modular architecture 2025-04-25 18:04:10 +02:00
requirements.txt Restructure project to use modular architecture 2025-04-25 18:04:10 +02:00

Git Project Creator

A Python script that streamlines the creation of new Git project directories. It automates the setup process by creating the necessary directory structure, initializing a Git repository, and adding essential files like README.md, .gitignore, and LICENSE.

Features

  • Creates organized project directories within a specified base directory
  • Supports project categorization through group directories
  • Generates README.md and .gitignore files from templates
  • Provides license selection from predefined templates
  • Initializes Git repositories automatically
  • Offers optional integration with gitignore helper scripts for advanced customization
  • Uses TOML configuration files for easy customization

Requirements

  • Python 3.6+
  • Git installed and available in the system's PATH
  • Required Python packages (automatically installed if missing):
    • tomli (TOML parser)

Installation

  1. Clone the repository:

    git clone https://codeberg.org/Tealk/git-project-helper.git
    cd git-project-helper
    
  2. Make the script executable:

    chmod +x app.py
    
  3. Run the script:

    ./app.py
    

Usage

Run the script using Python:

python app.py

Or directly if you made it executable:

./app.py

Workflow

  1. Select a Group: Choose an existing group directory or create a new one
  2. Enter Project Name: Provide a valid name for your project
  3. Choose a License: Select a license from available templates or use the default
  4. Project Setup: The script will:
    • Create the project directory
    • Add README.md, .gitignore, and LICENSE files
    • Initialize a Git repository
  5. Optional Gitignore Helper: If configured, you can run a gitignore helper for custom .gitignore configuration

Configuration

The script uses TOML configuration files for easy customization:

  • config/default.toml: Contains default settings (don't modify this directly)
  • config/user.toml: Use this file to override default settings (created on first run)

Configuration Options

[paths]
# Base directory for all git projects
git_base_dir = "~/GIT"
# Directory containing project templates
templates_dir = "~/Templates/Programming"

[templates]
# Template file paths (relative to templates_dir)
readme_template = "Git/README.md"
gitignore_template = "Git/gitignore"
licenses_dir = "Licenses"

[defaults]
# Default values
license = "MIT"
group = "Projects"

[helpers]
# Helper script path (leave empty to disable)
# See https://codeberg.org/Tealk/git-ignore-helper
gitignore_helper = ""

Project Structure

git-project-creator/
├── config/                # Configuration directory
│   └── default.toml      # Default configuration settings
├── src/                  # Source code directory
│   ├── config_loader.py  # Configuration loading utility
│   ├── dependency_checker.py # Checks and installs dependencies
│   ├── directory_utils.py # Directory management functions
│   ├── git_utils.py      # Git-related functions
│   ├── license_utils.py  # License selection utilities
│   ├── project_creator.py # Main project creation logic
│   └── template_utils.py # Template processing utilities
├── templates/            # Default fallback templates
│   ├── README.md         # Default README template
│   ├── gitignore         # Default gitignore template
│   └── LICENSE           # Default license template
├── app.py # Main executable script
└── requirements.txt      # Python dependencies

License

This project is licensed under the AGPL-3.0 License. For more details, see the LICENSE file.