cookiecutter的友好界面封装
项目描述
安装
要安装,请运行
pip install pieceofcake
使用
要使用pieceofcake
pieceofcake template output_directory
其中template遵循与cookiecutter相同的语法,可以是本地目录的路径,或者例如gh:astrofrog/fake-template,以使用GitHub存储库。
请注意,pieceofcake将与所有cookiecutter模板一起工作,但如果要在下面所述的模板创建者中包含cookiecutter.json文件中的_parameters键,则只会显示友好问题。
对于模板创建者
为了为每个参数定义问题,在您的cookiecutter.json文件中添加一个新的_parameters键,然后它应该包含每个参数的字典
"_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." } }
default_value、prompt和help键都是可选的 - 如果未定义default_value,则从主cookiecutter部分获取默认值。如果没有包括prompt,则将其设置为参数名称,如果没有包括help,则不会显示帮助/问题。
这种方法受到了cookiecutter/cookiecutter#794的启发
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪一个,请了解更多关于 安装包 的信息。
源代码分发
pieceofcake-0.1a2.tar.gz (5.7 kB 查看哈希值)
构建分发
pieceofcake-0.1a2-py3-none-any.whl (5.7 kB 查看哈希值)
关闭
pieceofcake-0.1a2.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 7c71a12b7f2008f2a830cf473135db169cb2e1313b96c6a4d70bed0b6a0c6003 |
|
MD5 | 6feda58cc27d9c1699b587de76ab9876 |
|
BLAKE2b-256 | a99dc07768ab925e4706a0b82a8e511dabe967c402d5f9eacbea32b5da32f4a5 |
关闭
pieceofcake-0.1a2-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 6c83ad74c0ffd568426f8e0aab2d3252a4fb3c71997ca5c74e58b04ae6fbcf1f |
|
MD5 | 2f4d8736ab5a086d6aada5d6616ac1be |
|
BLAKE2b-256 | 1787c96ebf7616ff50485c465c0490267b87fabab8f70ce2bd6aa90a5604ce89 |