Home

Awesome

<a href="https://pytask-dev.readthedocs.io/en/stable"> <p align="center"> <img src="https://raw.githubusercontent.com/pytask-dev/pytask/main/docs/source/_static/images/pytask_w_text.png" width=50% alt="pytask"> </p> </a>
<!-- Keep in sync with docs/source/index.md -->

PyPI PyPI - Python Version image image PyPI - License image image image pre-commit.ci status Ruff

<!-- Keep in sync with docs/source/index.md -->

pytask is a workflow management system that facilitates reproducible data analyses. Its features include:

Installation

<!-- Keep in sync with docs/source/tutorials/installation.md -->

pytask is available on PyPI and on Anaconda.org. Install the package with

$ pip install pytask

or

$ conda install -c conda-forge pytask

Color support is automatically available on non-Windows platforms. On Windows, please, use Windows Terminal, which can be, for example, installed via the Microsoft Store.

To quickly set up a new project, use the cookiecutter-pytask-project template or start from other templates or example projects.

Usage

A task is a function that is detected if the module and the function name are prefixed with task_. Here is an example.

# Content of task_hello.py.

from pathlib import Path

from pytask import Product
from typing import Annotated


def task_hello_earth(path: Annotated[Path, Product] = Path("hello_earth.txt")):
    path.write_text("Hello, earth!")

To execute the task, enter pytask on the command-line

image

Documentation

You find the documentation https://pytask-dev.readthedocs.io/en/stable with tutorials and guides for best practices.

Changes

Consult the release notes to find out about what is new.

License

pytask is distributed under the terms of the MIT license.

Acknowledgment

The license also includes a copyright and permission notice from pytest since some modules, classes, and functions are copied from pytest. Not to mention how pytest has inspired the development of pytask in general. Without the excellent work of Holger Krekel and pytest's many contributors, this project would not have been possible. Thank you!

pytask owes its beautiful appearance on the command line to rich, written by Will McGugan.

Repeating tasks in loops is inspired by ward written by Darren Burns.

Citation

If you rely on pytask to manage your research project, please cite it with the following key to help others to discover the tool.

@Unpublished{Raabe2020,
    Title  = {A Python tool for managing scientific workflows.},
    Author = {Tobias Raabe},
    Year   = {2020},
    Url    = {https://github.com/pytask-dev/pytask}
}