# Why?
The `dev_template` tool is designed with simplicity and speed in mind, providing a streamlined approach to setting up new Python projects. Unlike other feature-rich tools, `dev_template` focuses on quick development, allowing you to get started without the need to wade through extensive documentation (_hopefully_).
This tool was created to help enforce _better_ development standards, even for quick tools and hobbyist programs. It offers essential features that facilitate a consistent project structure and dependency management, making it ideal for developers who need a reliable setup process without the overhead of complex configurations.
For those who want a bit more customization, the project's `README` provides clear instructions on how to modify templates and configuration settings. Everything you need to know is right there, making it easy to tailor the tool to fit your specific needs. (_If you still have/find issues please submit an issue_).
With `dev_template`, you can start your projects quickly, maintain _good_ development practices, and avoid the hassle of extensive setup processes and documentation crawling.
## TLDR
_this tool is for those of us that are lazy_
## Features
* **User-Friendly**
* **Interactive Prompts:**
* Utilizes interactive prompts with directory path completion.
* **Cross-Platform Compatibility:**
* Handles platform-specific differences for paths and commands (e.g., Windows vs. Unix-like systems).
* **Project Directory Creation:**
* Creates a new project directory structure, including subdirectories (`src`, `tests`) and basic files (`README.md`, `.gitignore`, `requirements.txt`, etc.).
* Optionally creates `setup.py` and `pyproject.toml` based on configuration settings.
* **Configuration Management:**
* Uses a configuration file to manage default settings like packages to install, project path, and templates.
* Provides an interactive setup configuration option to modify default settings.
* **Template Copying:**
* Copies predefined templates for project files from a configured templates directory.
* Ability to replace template files in the config directory with their own personalized versions.
* **Virtual Environment Management:**
* Automatically creates a virtual environment for the new project.
* Installs specified packages into the virtual environment.
* **Package Management:**
* Installs packages specified by the user or from the default configuration.
* Allows specifying exact package versions during creation.
* Updates `requirements.txt` and `pyproject.toml` with successfully installed packages and their versions.
* **Error Handling:**
* Provides comprehensive error handling and logging for various operations, including directory creation, package installation, and user input validation.
* **Logging:**
* Supports debug logging for detailed execution trace.
## Example Demo
![Demo GIF](https://raw.githubusercontent.com/http-kennedy/dev_template/main/images/1.1.3.gif)
## Example Project Structure
```shell
project
├── project_venv
├── src
│ └── project
│ ├── __init__.py
│ └── main.py
├── tests
│ ├── __init__.py
│ └── test_main.py
├── .gitignore
├── README.md
├── requirements.txt
├── setup.py (creation disabled by default)
└── pyproject.toml (creation enabled by default)
```
### Pip Installation & Usage
To install the package using pip, run the following command:
```shell
pip install dev-template
```
Once installed, you can start the tool by typing the following command in your terminal:
```shell
dev_template
```
Alternatively, you can run it as a Python module:
```shell
python -m dev_template.dev_template
```
After setting up your project, navigate into the project directory and activate the virtual environment.
* **The virtual environment folder is named after your project (e.g., project_venv).**
For Linux/macOS:
```shell
source project_venv/bin/activate
```
For Windows (Powershell):
```shell
.\project_venv\Scripts\Activate.ps1
```
To deactivate the virtual environment, simply type:
```shell
deactivate
```
## Source Installation & Usage
1. Clone the repository, navigate to the project directory, create and activate a virtual environment:
* On MacOS/Linux:
```batch
git clone https://github.com/http-kennedy/dev_template.git
cd dev_template
python -m venv venv
source venv/bin/activate
```
* On Windows (Powershell):
```batch
git clone https://github.com/http-kennedy/dev_template.git
cd dev_template
python -m venv venv
.\venv\Scripts\Activate.ps1
```
2. Install the requirements:
```bash
pip install -r requirements.txt
```
3. Install the package:
* For interactive development (editable mode):
```shell
pip install -e .
```
* To install directly:
```shell
pip install .
```
Once installed, you can start the tool by typing the following command in your terminal:
```shell
dev_template
```
Alternatively, you can run the script directly:
```shell
python src/dev_template/dev_template.py
```
After setting up your project, navigate into the project directory and activate the virtual environment.
* **The virtual environment folder is named after your project (e.g., project_venv).**
For Linux/macOS:
```batch
source project_venv/bin/activate
```
For Windows (Powershell):
```powershell
.\project_venv\Scripts\Activate.ps1
```
To deactivate the virtual environment, simply type:
```shell
deactivate
```
## Command-Line Options
The `dev_template` tool can be ran with various flags to perform different actions. Here are the available options:
* `-h`, `--help`:
* Displays the help message with information about all available options.
* `-c`, `--config`:
* Enters configuration mode, allowing you to customize default settings such as default packages to install, default directory for projects, and whether to create `setup.py` and `pyproject.toml` files.
* `-d`, `--debug`:
* Enables debug logging for more detailed output during execution.
* **Log File Locations**
* Linux/macOS:
* Log files: `~/.config/dev_template/logs`
* Windows:
* Log files: `%LOCALAPPDATA%\dev_template\logs`
## Configuration Mode
The `dev_template` tool offers a configuration mode to customize default settings. You can enter configuration mode by running:
```shell
dev_template -c
```
or
```shell
dev_template --config
```
When in configuration mode you can set the following values:
* Default packages to install:
* Packages must be `commma delimited`.
* Can be modified during normal execution of `dev_template`
* If defining a specific version use pip's version specifier syntax.
* `'package_name'=='version'`
* For example: ```pandas==2.1.4```
* Absolute path for default project directory creation:
* Sets default input for where to create the project.
* Can be modified during normal execution of `dev_template`
* Create `setup.py` for new project directories:
* Choose whether to create a `setup.py` file in new project directories.
* Default is set to `No`
* Create `pyproject.toml` for new project directories:
* Choose whether to create a `pyproject.toml` file in new project directories.
* Default is set to `Yes`
**Configuration File Locations**
* Linux/macOS:
* Configuration file: `~/.config/dev_template/config.ini`
* Templates directory: `~/.config/dev_template/templates/`
* Windows:
* Configuration file: `%LOCALAPPDATA%\dev_template\config.ini`
* Templates directory: `%LOCALAPPDATA%\dev_template\templates\`
### Customizing Templates
* If you replace or modify any of the template files in the templates directory using the **same filename/s**, the customized files will be used during project setup.
## Roadmap
### Improvements
* **Logging Wrapper**: Implement a standardized logging wrapper.
* **Typer Package**: Enhance the command-line interface using the `typer` package.
### Features to Add
* Store virtual environments in the project directory or a user-specified location.
* Add version management and update notifications.
* Add an argument to remake the configuration directory.
* Allow custom project structures via the templates directory.
### NOTES TO REMEBER
----------------------
* If you need to install a specific package verison, use pip's version specifier syntax.
* `'package_name'=='version'`
* For example: ```pandas==2.1.4```
### KNOWN ISSUES
----------------------
* pyproject.toml: The `dependencies` section must be present in the `pyproject.toml` file. The absence of this section can cause installation issues.
* Config Template Directory: Problems may arise if not all expected files are present in the templates directory. Ensure that all necessary template files are included to avoid errors.
* Workaround: **Delete** `config directory` and re-run `dev_template`.
* For Linux/macOS: `~/.config/dev_template`
* For Windows: `%LOCALAPPDATA%\dev_template`
Raw data
{
"_id": null,
"home_page": null,
"name": "dev-template",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "automation, dependency management, development, hobbyist, project setup, project structure, python, quick start, template, tooling",
"author": "Kennedy, D.",
"author_email": "\"Kennedy, D.\" <kennedy@mylaptop.dev>",
"download_url": "https://files.pythonhosted.org/packages/6f/54/85af9d499d08072e0feee867a09c8a75bbebb52db152340cefcdd3ea022b/dev_template-1.1.6.tar.gz",
"platform": null,
"description": "# Why?\n\nThe `dev_template` tool is designed with simplicity and speed in mind, providing a streamlined approach to setting up new Python projects. Unlike other feature-rich tools, `dev_template` focuses on quick development, allowing you to get started without the need to wade through extensive documentation (_hopefully_).\n\nThis tool was created to help enforce _better_ development standards, even for quick tools and hobbyist programs. It offers essential features that facilitate a consistent project structure and dependency management, making it ideal for developers who need a reliable setup process without the overhead of complex configurations.\n\nFor those who want a bit more customization, the project's `README` provides clear instructions on how to modify templates and configuration settings. Everything you need to know is right there, making it easy to tailor the tool to fit your specific needs. (_If you still have/find issues please submit an issue_).\n\nWith `dev_template`, you can start your projects quickly, maintain _good_ development practices, and avoid the hassle of extensive setup processes and documentation crawling.\n\n## TLDR\n\n_this tool is for those of us that are lazy_\n\n## Features\n\n* **User-Friendly**\n\n* **Interactive Prompts:**\n * Utilizes interactive prompts with directory path completion.\n\n* **Cross-Platform Compatibility:**\n * Handles platform-specific differences for paths and commands (e.g., Windows vs. Unix-like systems).\n\n* **Project Directory Creation:**\n * Creates a new project directory structure, including subdirectories (`src`, `tests`) and basic files (`README.md`, `.gitignore`, `requirements.txt`, etc.).\n * Optionally creates `setup.py` and `pyproject.toml` based on configuration settings.\n\n* **Configuration Management:**\n * Uses a configuration file to manage default settings like packages to install, project path, and templates.\n * Provides an interactive setup configuration option to modify default settings.\n\n* **Template Copying:**\n * Copies predefined templates for project files from a configured templates directory.\n * Ability to replace template files in the config directory with their own personalized versions.\n\n* **Virtual Environment Management:**\n * Automatically creates a virtual environment for the new project.\n * Installs specified packages into the virtual environment.\n\n* **Package Management:**\n * Installs packages specified by the user or from the default configuration.\n * Allows specifying exact package versions during creation.\n * Updates `requirements.txt` and `pyproject.toml` with successfully installed packages and their versions.\n\n* **Error Handling:**\n * Provides comprehensive error handling and logging for various operations, including directory creation, package installation, and user input validation.\n\n* **Logging:**\n * Supports debug logging for detailed execution trace.\n\n## Example Demo\n\n![Demo GIF](https://raw.githubusercontent.com/http-kennedy/dev_template/main/images/1.1.3.gif)\n\n## Example Project Structure\n\n```shell\nproject\n\u251c\u2500\u2500 project_venv\n\u251c\u2500\u2500 src\n\u2502 \u2514\u2500\u2500 project\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2514\u2500\u2500 main.py\n\u251c\u2500\u2500 tests\n\u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2514\u2500\u2500 test_main.py\n\u251c\u2500\u2500 .gitignore\n\u251c\u2500\u2500 README.md\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 setup.py (creation disabled by default)\n\u2514\u2500\u2500 pyproject.toml (creation enabled by default)\n\n```\n\n### Pip Installation & Usage\n\nTo install the package using pip, run the following command:\n\n```shell\npip install dev-template\n```\n\nOnce installed, you can start the tool by typing the following command in your terminal:\n\n```shell\ndev_template\n```\n\nAlternatively, you can run it as a Python module:\n\n```shell\npython -m dev_template.dev_template\n```\n\nAfter setting up your project, navigate into the project directory and activate the virtual environment.\n\n* **The virtual environment folder is named after your project (e.g., project_venv).**\n\nFor Linux/macOS:\n\n```shell\nsource project_venv/bin/activate\n```\n\nFor Windows (Powershell):\n\n```shell\n.\\project_venv\\Scripts\\Activate.ps1\n```\n\nTo deactivate the virtual environment, simply type:\n\n```shell\ndeactivate\n```\n\n## Source Installation & Usage\n\n1. Clone the repository, navigate to the project directory, create and activate a virtual environment:\n\n* On MacOS/Linux:\n\n```batch\ngit clone https://github.com/http-kennedy/dev_template.git\ncd dev_template\npython -m venv venv\nsource venv/bin/activate\n```\n\n* On Windows (Powershell):\n\n```batch\ngit clone https://github.com/http-kennedy/dev_template.git\ncd dev_template\npython -m venv venv\n.\\venv\\Scripts\\Activate.ps1\n```\n\n2. Install the requirements:\n\n```bash\npip install -r requirements.txt\n```\n\n3. Install the package:\n\n* For interactive development (editable mode):\n\n```shell\npip install -e .\n```\n\n* To install directly:\n\n```shell\npip install .\n```\n\nOnce installed, you can start the tool by typing the following command in your terminal:\n\n```shell\ndev_template\n```\n\nAlternatively, you can run the script directly:\n\n```shell\npython src/dev_template/dev_template.py\n```\n\nAfter setting up your project, navigate into the project directory and activate the virtual environment.\n\n* **The virtual environment folder is named after your project (e.g., project_venv).**\n\nFor Linux/macOS:\n\n```batch\nsource project_venv/bin/activate\n```\n\nFor Windows (Powershell):\n\n```powershell\n.\\project_venv\\Scripts\\Activate.ps1\n```\n\nTo deactivate the virtual environment, simply type:\n\n```shell\ndeactivate\n```\n\n## Command-Line Options\n\nThe `dev_template` tool can be ran with various flags to perform different actions. Here are the available options:\n\n* `-h`, `--help`:\n * Displays the help message with information about all available options.\n\n* `-c`, `--config`:\n * Enters configuration mode, allowing you to customize default settings such as default packages to install, default directory for projects, and whether to create `setup.py` and `pyproject.toml` files.\n\n* `-d`, `--debug`:\n * Enables debug logging for more detailed output during execution.\n * **Log File Locations**\n * Linux/macOS:\n * Log files: `~/.config/dev_template/logs`\n * Windows:\n * Log files: `%LOCALAPPDATA%\\dev_template\\logs`\n\n## Configuration Mode\n\nThe `dev_template` tool offers a configuration mode to customize default settings. You can enter configuration mode by running:\n\n```shell\ndev_template -c\n```\n\nor\n\n```shell\ndev_template --config\n```\n\nWhen in configuration mode you can set the following values:\n\n* Default packages to install:\n * Packages must be `commma delimited`.\n * Can be modified during normal execution of `dev_template`\n * If defining a specific version use pip's version specifier syntax.\n * `'package_name'=='version'`\n * For example: ```pandas==2.1.4```\n\n* Absolute path for default project directory creation:\n * Sets default input for where to create the project.\n * Can be modified during normal execution of `dev_template`\n\n* Create `setup.py` for new project directories:\n * Choose whether to create a `setup.py` file in new project directories.\n * Default is set to `No`\n\n* Create `pyproject.toml` for new project directories:\n * Choose whether to create a `pyproject.toml` file in new project directories.\n * Default is set to `Yes`\n\n**Configuration File Locations**\n\n* Linux/macOS:\n * Configuration file: `~/.config/dev_template/config.ini`\n * Templates directory: `~/.config/dev_template/templates/`\n\n* Windows:\n * Configuration file: `%LOCALAPPDATA%\\dev_template\\config.ini`\n * Templates directory: `%LOCALAPPDATA%\\dev_template\\templates\\`\n\n### Customizing Templates\n\n* If you replace or modify any of the template files in the templates directory using the **same filename/s**, the customized files will be used during project setup.\n\n## Roadmap\n\n### Improvements\n\n* **Logging Wrapper**: Implement a standardized logging wrapper.\n* **Typer Package**: Enhance the command-line interface using the `typer` package.\n\n### Features to Add\n\n* Store virtual environments in the project directory or a user-specified location.\n* Add version management and update notifications.\n* Add an argument to remake the configuration directory.\n* Allow custom project structures via the templates directory.\n\n### NOTES TO REMEBER\n\n----------------------\n* If you need to install a specific package verison, use pip's version specifier syntax.\n * `'package_name'=='version'`\n * For example: ```pandas==2.1.4```\n\n### KNOWN ISSUES\n\n----------------------\n\n* pyproject.toml: The `dependencies` section must be present in the `pyproject.toml` file. The absence of this section can cause installation issues.\n\n* Config Template Directory: Problems may arise if not all expected files are present in the templates directory. Ensure that all necessary template files are included to avoid errors.\n * Workaround: **Delete** `config directory` and re-run `dev_template`.\n * For Linux/macOS: `~/.config/dev_template`\n * For Windows: `%LOCALAPPDATA%\\dev_template`\n",
"bugtrack_url": null,
"license": "CC0-1.0",
"summary": "A streamlined tool for quickly setting up Python project directories with simplicity and speed. Ideal for developers and hobbyists, dev_template offers interactive prompts, cross-platform compatibility, and robust configuration management to ensure a consistent project structure and efficient dependency management.",
"version": "1.1.6",
"project_urls": {
"Documentation": "https://github.com/http-kennedy/dev_template/blob/main/README.md",
"Homepage": "https://github.com/http-kennedy/dev_template",
"Source": "https://github.com/http-kennedy/dev_template",
"Tracker": "https://github.com/http-kennedy/dev_template/issues"
},
"split_keywords": [
"automation",
" dependency management",
" development",
" hobbyist",
" project setup",
" project structure",
" python",
" quick start",
" template",
" tooling"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d25c243432a055ca64664aa9c0dab85cbc90f4d9cfd78746f258b7e1b62660bf",
"md5": "cce654fb48959be88490ad1a3b921b9e",
"sha256": "36e21d82a06f3ee13114a2af67f1f7d99f89451a601e2e656ee31ca543c7a081"
},
"downloads": -1,
"filename": "dev_template-1.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cce654fb48959be88490ad1a3b921b9e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 16418,
"upload_time": "2024-07-06T15:54:34",
"upload_time_iso_8601": "2024-07-06T15:54:34.287762Z",
"url": "https://files.pythonhosted.org/packages/d2/5c/243432a055ca64664aa9c0dab85cbc90f4d9cfd78746f258b7e1b62660bf/dev_template-1.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6f5485af9d499d08072e0feee867a09c8a75bbebb52db152340cefcdd3ea022b",
"md5": "77b57a4bb573bea5446e18b75792dcf5",
"sha256": "0e1e2560d7fb734691daf952e8c8af9d6f1cad395fb9a561a65e462e53673939"
},
"downloads": -1,
"filename": "dev_template-1.1.6.tar.gz",
"has_sig": false,
"md5_digest": "77b57a4bb573bea5446e18b75792dcf5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 13410,
"upload_time": "2024-07-06T15:54:36",
"upload_time_iso_8601": "2024-07-06T15:54:36.012614Z",
"url": "https://files.pythonhosted.org/packages/6f/54/85af9d499d08072e0feee867a09c8a75bbebb52db152340cefcdd3ea022b/dev_template-1.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-06 15:54:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "http-kennedy",
"github_project": "dev_template",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "dev-template"
}