{"id":21128779,"url":"https://github.com/FelixHenninger/cookiecutter","last_synced_at":"2025-07-09T00:31:28.067Z","repository":{"id":193287695,"uuid":"367305805","full_name":"FelixHenninger/cookiecutter","owner":"FelixHenninger","description":"Generate Project Files from a Template","archived":false,"fork":false,"pushed_at":"2023-12-19T15:12:56.000Z","size":4509,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-28T17:32:39.748Z","etag":null,"topics":["r","reproducibility","research-software-engineering"],"latest_commit_sha":null,"homepage":"https://felixhenninger.github.io/cookiecutter","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FelixHenninger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-14T08:55:45.000Z","updated_at":"2024-09-12T16:59:45.000Z","dependencies_parsed_at":"2023-12-19T17:21:59.685Z","dependency_job_id":null,"html_url":"https://github.com/FelixHenninger/cookiecutter","commit_stats":null,"previous_names":["felixhenninger/cookiecutter"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixHenninger%2Fcookiecutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixHenninger%2Fcookiecutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixHenninger%2Fcookiecutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FelixHenninger%2Fcookiecutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FelixHenninger","download_url":"https://codeload.github.com/FelixHenninger/cookiecutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470716,"owners_count":17479368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["r","reproducibility","research-software-engineering"],"created_at":"2024-11-20T05:02:35.607Z","updated_at":"2024-11-20T05:02:44.163Z","avatar_url":"https://github.com/FelixHenninger.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"man/figures/logo_header.jpg\"\u003e\u003cbr\u003e\n  \u003ch1\u003ecookiecutter for \u003ccode\u003eR\u003c/code\u003e\u003c/h1\u003e\n\u003c/div\u003e\n\n**The `cookiecutter` package for `R` makes it easy to create new projects and files based on templates.** It can create directory structures and files, and customizes their contents based on predefined settings.\n\nThe package implements the core functionality of the excellent and much more flexible [Python implementation](https://github.com/cookiecutter/cookiecutter/), and complements the likewise fantastic [`usethis` package](https://usethis.r-lib.org/) that automates development steps within a project.\n\n----\n\n## Usage 🍪\n\n### Installation 📦\n\nThe package is [available on CRAN](https://cran.r-project.org/web/packages/cookiecutter), so that you can install it via\n\n```R\ninstall.packages('cookiecutter')\n```\n\nAlternatively, if you like to live on the bleeding edge, you can install the development version:\n\n```R\ndevtools::install_github('felixhenninger/cookiecutter@main')\n```\n\n### Making cookies 👩‍🍳\n\nTo get started, you'll need a `cookiecutter` template, and a place to extract it. For example, starting from a template directory you could run:\n\n```R\ncookiecutter::bake(\n  'template_directory',\n  'output_directory'\n)\n```\n\nIf you've downloaded a template as a compressed archive or a directory, you can clone it locally.\n\n```R\ncookiecutter::bake(\n  'template.zip',\n  'output_directory'\n)\n```\n\n----\n\n### Crafting a template 🛠\n\nIn principle, any directory you already have can serve as a `cookiecutter` template. Out of the box, if you use it as template, `cookiecutter` will simply copy the directory for you. Likewise, if you create a `zip`, `.tar` or `.tar.gz` archive of your directory, `cookiecutter` will unpack it into the output location.\n\nHowever, there are many more things you can do to make your template more user-friendly. Specifically, `cookiecutter` will change the names and contents of files according to your specifications. The way this works is that you can insert a placeholder, `{{ cookiecutter.my_variable }}` inside a file (or in its name or directory name), and `cookiecutter` will try to replace this placeholder (curly braces and all) with the contents of `my_variable`.\n\nIf you use the placeholder alone, your users will need to supply the values of any variables when they bake the template, like so (here, we set the variable `topping`, which you could use in a file or file name via `{{ cookiecutter.topping }}`):\n\n```R\ncookiecutter::bake(\n  'template.zip',\n  'output_directory',\n  extra_context = list(\n    topping = 'sprinkles'\n  )\n)\n```\n\nYou can help your users figure out which variables are available by adding a `cookiecutter.json` file to your template directory. If you do so, `cookiecutter` will know about the variables it needs, and prompt users to fill in or to choose a value. It will provide a default, or a list of choices, respectively.\n\nThe [format of this file](https://cookiecutter.readthedocs.io/en/stable/advanced/index.html) is documented fully in the Python cookiecutter documentation, but to give you an impression of the options, here's an example:\n\n```json\n{\n  \"cookie_eating_sound\": \"Om nom nom nom\",\n  \"cookie_local_term\": [\"cookie\", \"biscuit\"]\n}\n```\n\n----\n\n## Limitations ⚠️\n\nThe `cookiecutter` package for `R` aims to be compatible with its big sibling, but at present implements only a subset of their functionality.\n\nOf course, few of these issues are insurmountable, and they are great places to contribute!\n\n* We don't (yet) provide the full extent of the [Jinja templating language](https://jinja.palletsprojects.com/en/3.0.x/templates/) that `cookiecutter` uses. Specifically, at present, we don't support logic in templates.\n* Naturally, we don't support _Python code in templates_.\n* We don't currently support _cloning templates directly from a git repository_. You can still download the repository contents and clone from a directory or an archive.\n* We don't support `~/.cookiecutterrc` files.\n* We don't support running scripts automatically after populating a template.\n\nIf you're looking for the full power of [the original](https://github.com/cookiecutter/cookiecutter), we wholeheartedly recommend using it — our clone is designed to be a stop-gap, not a replacement. If we can whet your appetite, that's a win in our book!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFelixHenninger%2Fcookiecutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFelixHenninger%2Fcookiecutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFelixHenninger%2Fcookiecutter/lists"}