74 lines
3.0 KiB
Markdown
74 lines
3.0 KiB
Markdown
# Project Initializer Tool
|
|
|
|
A Python application to initialize standard project structures for new Python projects,
|
|
suitable for use with Git.
|
|
|
|
## Features
|
|
|
|
- Creates a defined directory structure for source code (`project_name/core`, `project_name/gui`).
|
|
- Generates basic files: `__init__.py`, `__main__.py`, `core.py`, `gui.py`.
|
|
- Creates a `doc/` directory with template `English-manual.md` and `Italian-manual.md`.
|
|
- Generates a basic `README.md` for the new project.
|
|
- Generates a `.spec` file template for PyInstaller.
|
|
- Copies a default `.ico` file.
|
|
- Creates a standard `.gitignore` file.
|
|
- Initializes a local Git repository with an initial commit.
|
|
- Supports both Command Line Interface (CLI) and Graphical User Interface (GUI) via Tkinter.
|
|
- Remembers the last used root directory for convenience in GUI mode.
|
|
|
|
## Structure of this Tool (`ProjectInitializerTool`)
|
|
|
|
This tool itself is organized as follows:
|
|
|
|
- `project_initializer/`: Main Python package for the tool.
|
|
- `__main__.py`: Entry point (`python -m project_initializer`).
|
|
- `core/`: Core logic for project creation.
|
|
- `project_creator.py`: Handles the actual file and directory generation.
|
|
- `config/`: Configuration and file templates.
|
|
- `settings.py`: Manages app config (like last used directory) and stores file templates.
|
|
- `gui/`: Tkinter GUI components.
|
|
- `app_window.py`: Defines the main application window.
|
|
- `cli/`: Command-line interface components.
|
|
- `interface.py`: Handles argument parsing and CLI interaction.
|
|
- `assets/`: Static assets for the tool.
|
|
- `default_icon.ico`: The default icon copied to new projects.
|
|
|
|
## Usage
|
|
|
|
### Prerequisites
|
|
- Python 3.7+ (ideally 3.8+ for `pathlib` features and type hinting usage)
|
|
- Git (optional, for repository initialization in new projects)
|
|
|
|
### Running the Tool
|
|
|
|
1. Navigate to the `ProjectInitializerTool` directory (the one containing this README).
|
|
2. Execute the tool using the Python module execution:
|
|
|
|
**GUI Mode (Recommended for interactive use):**
|
|
```bash
|
|
python -m project_initializer
|
|
```
|
|
This will launch the graphical interface.
|
|
|
|
**CLI Mode (For scripting or command-line preference):**
|
|
```bash
|
|
python -m project_initializer <root_directory> <ProjectName>
|
|
```
|
|
- `<root_directory>`: The directory where the new project folder (named `<ProjectName>`) will be created.
|
|
- `<ProjectName>`: The desired name for your new project (e.g., "MyNewApp").
|
|
|
|
Example:
|
|
```bash
|
|
python -m project_initializer /home/user/dev/projects MyCoolProject
|
|
```
|
|
|
|
This will create a folder `/home/user/dev/projects/MyCoolProject` with the standard structure.
|
|
|
|
### Configuration
|
|
The tool saves the last used root directory in a configuration file (`.project_initializer_config.json`) in your user's home directory.
|
|
|
|
## Development (of this `ProjectInitializerTool`)
|
|
|
|
- Ensure you have Python installed.
|
|
- The `default_icon.ico` file should be present in `project_initializer/assets/`.
|
|
- To run during development: `python -m project_initializer` from the `ProjectInitializerTool` directory. |