A user-friendly wrapper to cookiecutter
Project description
Installing
To install, run:
pip install pieceofcake
Using
To use pieceofcake:
pieceofcake template output_directory
where template follows the same syntax as for cookiecutter, and can be the path to a local directory, or e.g. gh:astrofrog/fake-template to use a GitHub repository.
Note that pieceofcake will work with all cookiecutter templates, but nice questions will only be shown if the cookiecutter.json file contains the _parameters key as described below in For template creators.
For template creators
To define questions for each parameter, add a new _parameters key in your cookiecutter.json file, which should then contain a dictionary for each parameter:
"_parameters": { "package_name": { "default_value": "test-package", "prompt": "Package name", "help": "What is the name of your package? This is the name that will appear on PyPI and which users will use when installing the package with e.g. pip or conda." }, "include_example_code": { "prompt": "Include example code?", "help": "Should example code be included? This will consist of sample Python and Cython files in the package, demonstrating how to create different sub-modules and importing between them." } }
The default_value, prompt, and help keys are all optional - if default_value is not defined, the default value is taken from the main cookiecutter section. If prompt is not included, it is set to the parameter name, and if help is not included, no help/question is shown.
This approach was inspired by cookiecutter/cookiecutter#794
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file pieceofcake-0.1a2.tar.gz
.
File metadata
- Download URL: pieceofcake-0.1a2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200123 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c71a12b7f2008f2a830cf473135db169cb2e1313b96c6a4d70bed0b6a0c6003 |
|
MD5 | 6feda58cc27d9c1699b587de76ab9876 |
|
BLAKE2b-256 | a99dc07768ab925e4706a0b82a8e511dabe967c402d5f9eacbea32b5da32f4a5 |
File details
Details for the file pieceofcake-0.1a2-py3-none-any.whl
.
File metadata
- Download URL: pieceofcake-0.1a2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.1.0.post20200123 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c83ad74c0ffd568426f8e0aab2d3252a4fb3c71997ca5c74e58b04ae6fbcf1f |
|
MD5 | 2f4d8736ab5a086d6aada5d6616ac1be |
|
BLAKE2b-256 | 1787c96ebf7616ff50485c465c0490267b87fabab8f70ce2bd6aa90a5604ce89 |