$ show drivendataorg/cookiecutter-data-science
Cookiecutter Data Science (CCDS) is a CLI tool that generates standardized, opinionated project scaffolds for data science work. It wraps the cookiecutter templating engine with custom prompting logic that supports nested configuration choices (e.g., cloud storage options with sub-fields for bucket names), and post-generation hooks that dynamically write dependency files in multiple formats (requirements.txt, pyproject.toml, environment.yml, Pipfile, pixi.toml), configure linting/formatting tools (ruff or flake8+black+isort), set up testing frameworks (pytest/unittest), and scaffold code modules with boilerplate for data processing, feature engineering, modeling, and visualization. The tool is designed to be run via the `ccds` command, which defaults to the DrivenData template repository and the installed version of the template. The codebase demonstrates solid software engineering: it monkey-patches cookiecutter's internals in a controlled way to add functionality (prompting with sub-options, custom context file selection), provides a suite of reusable hook utilities for dependency management and custom config injection, and maintains extensive test coverage across multiple operating systems and environment managers (conda, virtualenv, pipenv, uv, pixi, poetry). The architecture is a thin CLI application that delegates to cookiecutter while extending it through monkey-patching and post-generation hooks. It is not a data research project itself but a tool for creating such projects.
The LLM identified 3 files worth highlighting for reuse:
Generates dependency configuration files in multiple formats (requirements.txt, pyproject.toml, environment.yml, Pipfile, pixi.toml) based on user-selected options. Encapsulates all output logic in a single module, including Python version specifier resolution, pixi-specific configuration generation, and formatting tomlkit documents. Could be extracted and reused by any project generator that needs to produce standard dependency files from a set of packages and options.
Overrides cookiecutter's prompt_for_config and generate_context functions to support nested choice/sub-field prompts (e.g., selecting cloud storage type then entering bucket name) and to point to a custom context file (ccds.json instead of cookiecutter.json). Demonstrates a controlled monkey-patch pattern that extends a third-party library without forking it, enabling richer interactive configuration. The logic is isolated and could be adapted for other projects needing hierarchical user input.
Handles user-supplied custom configuration by accepting a local directory path, a zip file URL, or a VCS repository URI, then cloning/downloading/extracting and copying it into the generated project. Implements a robust fallback chain to determine the source type and handles temporary directories cleanly. This pattern is reusable for any project scaffolder that allows users to overlay custom templates or configs.