Skip to main content

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.

Metadata

Release files for cp-template 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cp-template 0.3.0
File Size Uploaded
cp-template-0.3.0.tar.gz 3.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cp-template 0.3.0
File Interpreter ABI Platform
cp_template-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / cp-template-0.3.0.tar.gz

Download URL cp-template-0.3.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2306a4990e78f52b26bae5db2b1ae89c63078096d23e14d9f40b80fabd8cc44c
BLAKE2b-256 checksum
How to use checksums
65cdfc9be039abb9fa0be57f774791da0241f6da6e905a00d3799ef4b38891a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.9 Darwin/21.3.0

Release files / cp_template-0.3.0-py3-none-any.whl

Download URL cp_template-0.3.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
199b400261e464e57186ee45fb9ed6ec82f1072b253ebed8815ba244e6dcb9a5
BLAKE2b-256 checksum
How to use checksums
bb57b513c0434b5919c4ef4da104ea6017b7b4934fb8382d80a50f37810f4e06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.13 CPython/3.9.9 Darwin/21.3.0

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page