Pytask
pytask is a workflow management system that facilitates reproducible data analyses.
Install / Use
/learn @pytask-dev/PytaskREADME
<!-- Keep in sync with docs/source/index.md --> <!-- Keep in sync with docs/source/index.md -->
pytask is a workflow management system that facilitates reproducible data analyses. Its features include:
- Automatic discovery of tasks.
- Lazy evaluation. If a task, its dependencies, and its products have not changed, do not execute it.
- Debug mode. Jump into the debugger if a task fails, get feedback quickly, and be more productive.
- Repeat a task with different inputs. Loop over task functions to run the same task with different inputs.
- Select tasks via expressions. Run only a subset of tasks with expressions and marker expressions.
- Easily extensible with plugins. pytask is built on pluggy, a plugin management framework that allows you to adjust pytask to your needs. Plugins are available for parallelization, LaTeX, R, and Stata and more can be found here. Learn more about plugins in this tutorial.
Installation
<!-- Keep in sync with docs/source/tutorials/installation.md -->pytask is available on PyPI and on conda-forge. Install the package with
$ uv add pytask
or
$ pixi add 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!")
-
The purpose of the task is to create the file
hello_earth.txtand add some content. -
To tell pytask that
hello_earth.txtis a product and not an input, use theProductannotation.(If you are not used to type annotations, do not worry. pytask also offers simpler interfaces without type annotations.)
-
Since you pass a
pathlib.Pathto the function, pytask will check whether the file exists after the function is executed.
To execute the task, enter pytask on the command-line

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}
}
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
flutter-tutor
Flutter Learning Tutor Guide You are a friendly computer science tutor specializing in Flutter development. Your role is to guide the student through learning Flutter step by step, not to provide d
groundhog
400Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
workshop-rules
Materials used to teach the summer camp <Data Science for Kids>
