Skip to main content

A logical, reasonably standardized but flexible project structure for doing and sharing scientific research.

Project description

๐Ÿงช Cookiecutter Scientific Research

A standardized, flexible template for scientific research projects

Project Overview โ€ข Features โ€ข Quick Start โ€ข Project Structure โ€ข Development Guide โ€ข Acknowledgements โ€ข License

๐Ÿ“‹ Project Overview

Cookiecutter Scientific Research is a project template generator designed for scientific research projects, aimed at providing a standardized structure and tool configuration to help researchers focus on scientific discovery rather than project setup. Through predefined best practices, this template supports high-quality scientific computing and data analysis workflows, ensuring the reproducibility and reliability of the research process.

โœจ Features

  • Standardized Project Structure - Conforms to best practices for modern scientific computing projects

  • Reproducible Experimental Environment - Built-in environment management and dependency locking mechanisms

  • Integrated Documentation System - Preconfigured MkDocs documentation for showcasing research results

  • Testing and Quality Control - Built-in testing frameworks and code quality tools

  • Modern Package Management - Simplifies dependency management using modern tools like uv/pip

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.9 or higher
  • uv or pipx (recommended for tool installation)

Installation

This project is available on PyPI. As a cross-project tool, we recommend using uv or pipx for installation:

# Install using uv (recommended)
uv tool install cookiecutter-scientific-research

# Or install using pipx
pipx install cookiecutter-scientific-research

Creating a New Project

After installation, simply run the following command and follow the prompts:

ccsr

Initializing the Project Environment

After creating the project, navigate to the project directory and initialize the environment:

cd your-project-name

# Use uv to manage dependencies (recommended)
uv lock
uv sync

๐Ÿ“‚ Project Structure

The generated project follows the directory structure below, with each section having a clear responsibility:

โ”œโ”€โ”€ LICENSE            <- Project license
โ”œโ”€โ”€ Makefile           <- Makefile with common commands
โ”œโ”€โ”€ README.md          <- Project documentation
โ”œโ”€โ”€ pyproject.toml     <- Project configuration and dependency management
โ”‚
โ”œโ”€โ”€ data               <- Data directory
โ”‚   โ”œโ”€โ”€ external       <- Third-party data
โ”‚   โ”œโ”€โ”€ interim        <- Intermediate processed data
โ”‚   โ”œโ”€โ”€ processed      <- Final analysis datasets
โ”‚   โ””โ”€โ”€ raw            <- Original data (read-only)
โ”‚
โ”œโ”€โ”€ {{ cookiecutter.module_name }}  <- Project source code
โ”‚   โ”œโ”€โ”€ __init__.py    <- Package initialization file
โ”‚   โ”œโ”€โ”€ config.py      <- Configuration parameter management
โ”‚   โ”œโ”€โ”€ dataset.py     <- Data acquisition and loading
โ”‚   โ”œโ”€โ”€ plots.py       <- Data visualization functions
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ analyze        <- Data analysis module
โ”‚   โ”‚   โ””โ”€โ”€ analysis.py
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ modeling       <- Model training and prediction
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ”œโ”€โ”€ predict.py <- Model prediction
โ”‚   โ”‚   โ””โ”€โ”€ train.py   <- Model training
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ models         <- Model definitions
โ”‚   โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”‚   โ””โ”€โ”€ model.py   <- Model architecture
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ process        <- Data processing
โ”‚   โ”‚   โ””โ”€โ”€ features.py <- Feature engineering
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ utils          <- Utility functions
โ”‚       โ”œโ”€โ”€ __init__.py
โ”‚       โ””โ”€โ”€ tools.py   <- General utilities
โ”‚
โ”œโ”€โ”€ notebooks          <- Jupyter/Marimo notebooks
โ”‚                         (Naming convention: number-creator-description)
โ”‚
โ”œโ”€โ”€ docs               <- Project documentation (MkDocs)
โ”‚
โ”œโ”€โ”€ references         <- Reference materials and literature
โ”‚
โ”œโ”€โ”€ reports            <- Analysis reports and results
โ”‚   โ”œโ”€โ”€ figures        <- Generated charts
โ”‚   โ””โ”€โ”€ logs           <- Experiment logs
โ”‚
โ””โ”€โ”€ tests              <- Test directory

๐Ÿ”ง Development Guide

Package Management and Building

This project uses flit_core as the build backend, supporting modern Python package management. To build distribution packages:

# Install build dependencies
uv lock
# Install all optional dependencies
uv sync --all-extras
# Or install specific dependency groups
uv sync -e dev    # Development dependencies
uv sync -e test   # Testing dependencies
uv sync -e docs   # Documentation dependencies

# Build distribution packages
uv build

The built wheel files and source distribution packages will be saved in the dist/ directory.

Project Customization

During the template generation process, you can customize various aspects of the project according to prompts:

  • Project name and module name
  • Author information
  • License type
  • Dependency management method
  • Test framework selection
  • And more

๐Ÿ™ Acknowledgements

This project is modified from cookiecutter-data-science, special thanks to the DrivenData team for providing the excellent template and inspiration. The project has been customized for scientific research scenarios on the original basis, including tool chain optimization, workflow adjustments, and documentation structure optimization.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cookiecutter_scientific_research-1.0.3.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cookiecutter_scientific_research-1.0.3.tar.gz.

File metadata

File hashes

Hashes for cookiecutter_scientific_research-1.0.3.tar.gz
Algorithm Hash digest
SHA256 fe9b4e1c0b6504be874da95c9afa17db95d2e66c619eccd8e12f158bf9f0e6c2
MD5 c9bc7b9c3f68758cec7435eebe4a0719
BLAKE2b-256 6f83b6e7d0725229ac4213740f2c970e4413495a45cba5fc83867b5ba07c30ee

See more details on using hashes here.

File details

Details for the file cookiecutter_scientific_research-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for cookiecutter_scientific_research-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 848010193aa8fc9240dd3b13cc444528e6bf3847ff3cc655167c808c05fd7538
MD5 6fd68a39cba790113ec3a9fe980f051e
BLAKE2b-256 14ebe2da7a4f424eef6f3c32d6e09403ded98bcda04650f6ee3eb7482e97d041

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page