A tool to copy templated directories
Project description
cp-template
This is a very simple utility to generate directories based on templates.
Install
pip install cp-template
Usage
cp-template TEMPLATE_PATH DESTINATION_PATH key=value ...
Suppose you have the following directory structure (Note: the {{}}s are part of the filenames)
{{project}}/
.gitignore
README.md # File contains "{{project}} by {{author}}"
{{project}}/
__init__.py
Then you can run the following command:
cp-template './{{project}}' pineapple author=me
And it will generate this in the current directory:
pineapple/
.gitignore
README.md # File contains "pineapple by me"
pineapple/
__init__.py
The template directory does not have to contain {{...}}. If it does not, the stem of the destination path (last part of the path minus the extension) is placed in the STEM variable, so you can refer to it in the files using {{STEM}}.
More features will be added as I need them, but feel free to make PRs to contribute some.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cp-template-0.3.0.tar.gz.
File metadata
- Download URL: cp-template-0.3.0.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.9 Darwin/21.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2306a4990e78f52b26bae5db2b1ae89c63078096d23e14d9f40b80fabd8cc44c
|
|
| MD5 |
a15cdcddb6e3d20e7f741de3735080c4
|
|
| BLAKE2b-256 |
65cdfc9be039abb9fa0be57f774791da0241f6da6e905a00d3799ef4b38891a5
|
File details
Details for the file cp_template-0.3.0-py3-none-any.whl.
File metadata
- Download URL: cp_template-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.9.9 Darwin/21.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
199b400261e464e57186ee45fb9ed6ec82f1072b253ebed8815ba244e6dcb9a5
|
|
| MD5 |
56e623061841a81f4a75dab684819485
|
|
| BLAKE2b-256 |
bb57b513c0434b5919c4ef4da104ea6017b7b4934fb8382d80a50f37810f4e06
|