Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

pieceofcake - a user-friendly cookiecutter wrapper

This is a wrapper around the cookiecutter tool which provides a more user-friendly way of asking questions.

With cookiecutter, the user is not presented with any questions, just the names of the parameters to set:

% cookiecutter gh:astrofrog/fake-template
package_name [example]: test-package
include_example_code [n]: y

With pieceofcake, the user is shown a series of verbose questions which provide more context as to the meaning/implications of each parameter:

% cookiecutter gh:astrofrog/fake-template final-package

Welcome to the pieceofcake, a user-friendly cookiecutter wrapper!

This script will now ask you a series of questions to help you set up
your package.

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.
> Package name [example]: test-package

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.
> Include example code? [n]: y

Running cookiecutter...

You should now be all set! Your generated package is in final-package

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

Release files for pieceofcake 0.1a2

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

Source distribution (sdist)

Source distribution for pieceofcake 0.1a2
File Size Uploaded
pieceofcake-0.1a2.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pieceofcake 0.1a2
File Interpreter ABI Platform
pieceofcake-0.1a2-py3-none-any.whl Python 3 none any Details

Total release size: 11.4 kB

Release files / pieceofcake-0.1a2.tar.gz

Download URL pieceofcake-0.1a2.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7c71a12b7f2008f2a830cf473135db169cb2e1313b96c6a4d70bed0b6a0c6003
BLAKE2b-256 checksum
How to use checksums
a99dc07768ab925e4706a0b82a8e511dabe967c402d5f9eacbea32b5da32f4a5
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pieceofcake-0.1a2-py3-none-any.whl

Download URL pieceofcake-0.1a2-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6c83ad74c0ffd568426f8e0aab2d3252a4fb3c71997ca5c74e58b04ae6fbcf1f
BLAKE2b-256 checksum
How to use checksums
1787c96ebf7616ff50485c465c0490267b87fabab8f70ce2bd6aa90a5604ce89
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.1a2 This release

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