SciCookie is a template developed by Open Science Labs that creates projects from project templates and is based on Cookiecutter. It serves as an initial structure which can be used by beginners as well as full-fledged developers to simplify the project creation process and save considerable amount of time. SciCookie enables projects with an initial layout that includes recommended tools, workflows, and project structure.
SciCookie also offers other features that can enhance the workflow of the development process. Features such as automatic documentation generation, automated testing, and project-specific configuration are part of this. Overall, SciCookie is an efficient tool that gives users the ability to effortlessly create consistent, high-quality projects.
SciCookie is primarily based on the PyOpenSci recommendations who is actively conducting research to determine the tools, libraries, best practices, and workflows utilized by significant scientific Python groups. As a result, this template offers to authors a starting point for their project that adheres with industry standards and can be adjusted to meet particular project requirements.
- GitHub repo: https://github.com/osl-incubator/scicookie/
- Software License: BSD license
- Allows package slug (use
_
instead of-
) - Licenses supported: MIT, BSD 3 Clause, ISC License, Apache Software License 2.0, and GPL 3
- Documentation engines: mkdocs, sphinx-rst, sphinx-myst, jupyter-boook, quarto
- Test library: pytest, hypothesis
- Auto format code tools: black, ruff and prettier.
- Code style with Flake8.
- Allows Ruff to be used as a linter.
- Initial integration with git
- Support to conda (as base environment) and poetry as packaging and dependency management
- Support to pre-commit
- Static analysis of shell scripts using ShellCheck.
- Support for Makim and Make as automation tools.
- You can choose between different code of conduct, roadmap and governance documents based on recognized community documents.
- CI options: github actions, circleci, azure pipelines and gitlab CI.
- Release workflow with semantic release
- Flexible build system selection: Choose between popular build systems like Poetry, Flit, meson-python, Setuptools, PDM, Hatch, Pixi, Maturin, scikit-build-core or setuptools + pybind11 based on your preference.
- The structure of the project can use the src layout or flat layout. The “src layout” moving the code that is intended to be importable into a subdirectory. This subdirectory is typically named src. "Flat layout" refers to organising a project's files in a folder or repository so that the various configuration files and import packages are all in the top-level directory. You can read about their differences at https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/
- Finding common security problems in Python code using bandit
- Offers the option to use pydocstyle for checking compliance with Python documentation conventions.
- Finds unused code in Python programs using vulture.
- To automatically detect overly complex code based on cyclomatic complexity, the template gives you the option to use the McCabe library, which is included via flake8.
- Choose between Click and Argparse as Command Line Interface (CLI)
- Code coverage testing with Coverage.
- Provides the option to add initial files that allow you to run and orchestrate
containers using Docker (Podman is supported
through
docker-compose
).
pip install scicookie
Go to a desired folder to create your new project, for example:
cd ~/dev/my-python-projects
Generate a Python package project:
scicookie
Use a profile as an alternative
A profile is a set of template-specific settings. OSL has a specific profile with the libraries we recommend. You can use it to generate the project by running:
scicookie --profile osl
Note: If the --profile osl
flag omitted, the default SciCookie profile
will be used
You can also use it with pipx
:
pipx run scicookie --profile osl
For testing your changes locally, you can run:
makim tests.lint
makim tests.unit
makim tests.smoke
- Anavelyz Perez - @Anavelyz
- Ankit Kumar - @ayeankit
- Ever Vino - @EverVino
- Ivan Ogasawara - @xmnlab
- Saransh Chopra - @Saransh-cpp
- Yurely Camacho - @YurelyCamacho
Open Science Labs has been awarded two grants from the Python Software Foundation (PSF) in April 2023 and January 2024 to enhance SciCookie. The grants were and will be used to implement best practices recommended by pyOpenSci, improve dependencies and configuration settings, and add new features.
We are grateful for the support of the Python Software Foundation. For further details about these grants, you can read more in the blog posts: