Package: nukikata
nukikataJapanese forcookiecutter: クッキーの抜き型 - Kukkī no nukikata | Direct translation: To shape or moldFork ofNukikata Documentation:https://insight-infrastructure.github.io/nukikataAPI DocsCookiecutter Documentation:https://cookiecutter.readthedocs.ioGitHub:https://github.com/cookiecutter/cookiecutterPyPI:https://pypi.org/project/nukikata/Free and open source software:BSD licenseCookiecutteris the worlds most popular code scaffolding tool with over4 thousand open source cookiecuttersavailable today.  This fork includes many additional features including:LoopsConditionalsPluginsInspired byAnsible'ssyntax, this project aims to be a flexible declarative CLI that is easy to write operators for to extend functionality. It was originally built to extend cookiecutter to include conditionals and loops in the configuration file format.  We are now looking at it as an upstream declarative CLI sandbox to prove out patterns that can either be integrated back into cookiecutter or fit a variety of other use cases.Quick Demopip3 install nukikata
nukikata https://github.com/insight-infrastructure/nukikata-demosNote: If you experience installation errors trypip3 install nukikata --no-binary :all:.FeaturesAll cookiecutter features are supported in addition to loops, conditionals, and plugins. These features are only available to supplied dictionary objects with atypekey to trigger the associatedoperator. Loops and conditionals are triggered by renderingjinjaexpressions per the example below. Other cookiecutters can be called from a single nukikata to knit together modularized components.nuki.yaml---name:type:input# Input boxmessage:What is your name?colors:type:checkbox# Multi selector - returns a listmessage:What are your favorite colors?choices:-blue-green-greyoutcome:type:select# Single selector - returns a stringmessage:What is the airspeed velocity of an unladen swallow??choices:-flung-off-bridge:I donno-walk-across-bridge:What do you mean? African or European swallow?bad_outcome:type:printstatement:Wrong answer {{ nuki.name }}...when:"{{nuki.outcome=='flung-off-bridge'}}"color_essays:type:inputmessage:Please tell me how much you like the color {{nuki.item}}?default:Oh color {{nuki.item}}, you are so frickin cool...# loops over nuki.colorsloop:"{{nuki.colors}}"when:"{{nuki.colors|length>1}}"democmd:type:commandcommand:pwddump_yaml:type:yamlcontents:"{{nuki}}"path:"{{calling_directory}}/output.yaml"Here the jinja default context key goes to the name of file - ie{{ nuki.<> }}but can be customized if needed. We can also see the use of a special variablePrompts are enhanced by extending the functionality fromPyInquireras a set of operators as noted by the typesinput,list, andcheckbox. Writing new operators is super simple as seen in theprintoperator:cookiecuttuer/operators/print.pyclassPrintOperator(BaseOperator):type='print'def__init__(self,*args,**kwargs):super(PrintOperator,self).__init__(*args,**kwargs)def_execute(self):print(self.operator_dict['statement'])returnself.operator_dict['statement']New operator PRs welcome.  We're aiming to interface with various APIs and popular libraries to create simple ways to conditionally call and loop through popular methods.OperatorsOver 35 different operators are currently available with more coming down the line. To understand how to use them, please refer to theAPI Docs.The main type of operators are derivations ofPyInquirerwhich greatly enhanced the capabilities of the original cookiecutter due to the ability to use multi-select inputs that return lists. Please inspect thePyInquirerAPI docs to understand the interface. All features are supported except forvalidationandfilterwhich is not supported andwhenwhich is implemented in jinja.To see a number of good examples of the types of interfaces available for each operator, consider downloading the demo above and walking through the syntax.Note to Users and DevelopersThis is a very early WIP but has long term ambitions of being a sort of swiss army knife for management of configuration files and boilerplate. Please consider contributing or leaving your comments in the issues section on where you see this project going and what features you would like added.This project intends on being an edge release ofcookiecutterand would not have been possible were it not for the orginal maintainers of that repository.  Development in this repository is meant to be a proving ground for features that could be implemented and merged into the originalcookiecutterrepository. Please consider supporting both projects.Windows will not have first class support. Several operators are built for POSIX systems.  PRs welcome to build in full support.  Basic features like PyInquirer style prompts are supported.