Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/h3x4g0ns/py-templater
utility tool that generates code files from user-defined templates
https://github.com/h3x4g0ns/py-templater
pip python templater
Last synced: about 1 month ago
JSON representation
utility tool that generates code files from user-defined templates
- Host: GitHub
- URL: https://github.com/h3x4g0ns/py-templater
- Owner: h3x4g0ns
- License: mit
- Created: 2022-07-16T05:57:45.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-25T01:10:13.000Z (over 2 years ago)
- Last Synced: 2024-11-07T05:42:22.354Z (2 months ago)
- Topics: pip, python, templater
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - h3x4g0ns/py-templater - utility tool that generates code files from user-defined templates (Python)
README
# py-templater
![pypi build](https://img.shields.io/github/workflow/status/h3x4g0ns/py-templater/pypi-build)
[![PyPI version](https://badge.fury.io/py/py-templater.svg)](https://badge.fury.io/py/py-templater)## About this Project
Python utility tool that generates code files from user-defined templates. Save files/directories and user-defined templates, and load them on the fly whenever you need access to your boilerplate templates.
## Getting Started
### Prerequisites
You will need `typer` and `rich` in order to use `py-templater`. These should install as dependencies by default.
```sh
pip install py-templater typer rich
```> ⚠️ Warning
> `py-templater` only works on Linux and macOS machines### Usage
```sh
templater --help
Usage: templater [OPTIONS] COMMAND [ARGS]...
Options
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or customize the installation.
--help Show this message and exit.Commands
add Add a new template
gen Generates file(s) from templates
list List current current templates
rm Delete a template
view View template head
```#### `add`
Allows user to define a file/directory as new template
```sh
templater add --helpUsage: templater add [OPTIONS] NAME PATH
Arguments
name template name
path path to original file/directory
```#### `gen`
Generates any user defined templates in the current working directory
```sh
templater gen --helpUsage: templater gen [OPTIONS] NAME
Arguments
name template name
```#### `list`
Lists all user-defined templates and corresponding metadata
```sh
templater list --help
Usage: templater list [OPTIONS]
```#### `rm`
Allows user to delete any user-defined templates
```sh
templater rm --helpUsage: templater rm [OPTIONS]
```#### `view`
Views head snippet of template
```sh
templater view --helpUsage: templater view [OPTIONS] NAME [N]
Arguments
name template name
n (default: 5) numbers of lines to show