Skip to content

edesz/cpds-template

Repository files navigation

Python Data Analysis Template

This project uses copier to provide an opinionated template for Python data science projects using Jupyter notebooks. This template is based on the cookiecutter-data-science template.

Static Badge Static Badge

Usage

Use one of the two approaches below to create a new project in ~/Downloads/<project-slug>

Using copier

  1. Install copier and related Python libraries
    pip install copier jinja2-time copier-template-extensions
  2. Create a new project from the copier template
    copier copy https://github.com/edesz/cpds-template.git ~/.Downloads
    where
    • https://github.com/edesz/cpds-template.git
    • ~/.Downloads

Using copier with pixi

  1. Install pixi using the official pixi documentation.
  2. Create a temporary directory at ~/Downloads/projects.
  3. Place the following pixi.toml file in the temporary directory
    # ~/Downloads/projects/pixi.toml
    [workspace]
    name = "cpds-template"
    channels = ["conda-forge"]
    platforms = ["linux-64"]
    version = "0.1.0"
    
    [dependencies]
    python = ">3.10"
    
    [pypi-dependencies]
    copier = "*"
    jinja2-time = "*"
    copier-template-extensions = "*"
    
    [tasks]
    start = "copier copy https://github.com/edesz/cpds-template.git ../Downloads --trust"
  4. Configure pixi.toml for use
    • without downloading the copier template
      • no changes required
    • after downloading the template
      • clone the template locally to ~/Downloads using
        git clone https://github.com/edesz/cpds-template.git
      • replace the last line of pixi.toml with the following
        start = "copier copy ../cpds-template . --trust"
        where
        • ../cpds-template resolves to ~/Downloads/cpds-template
          • this is the copier copy source template path (src_path), which is a string that can be resolved to the local path to the cloned copier template
        • . resolves to ~/Downloads
          • this is the copier copy destination path (dst_path), which is the destination path where to render the templated project
  5. Change into the temorary directory
    cd Downloads/projects
  6. Create a new project from the copier template
    pixi run start
    which will create a new project in ~/Downloads/<project-slug>.

To Be Done

  1. Write tests for this copier template.
  2. Add demo notebook.
  3. Run demo notebook using papermill_runner.py with a copier task (post-gen hook).

About

My template for personal data science projects

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published