CLI Reference¶
Running pytask without a subcommand is equivalent to pytask build.
Command Index¶
pytask build: Collect tasks, execute them and report the results.pytask clean: Clean the provided paths by removing files unknown to pytask.pytask collect: Collect tasks and report information about them.pytask dag: Create a visualization of the directed acyclic graph.pytask lock: Inspect and update recorded task state in the lockfile.pytask markers: Show all registered markers.pytask profile: Show information about resource consumption.
pytask¶
Manage your tasks with pytask.
Usage
pytask [OPTIONS] COMMAND [ARGS]...
Commands
pytask build: Collect tasks, execute them and report the results.pytask clean: Clean the provided paths by removing files unknown to pytask.pytask collect: Collect tasks and report information about them.pytask dag: Create a visualization of the directed acyclic graph.pytask lock: Inspect and update recorded task state in the lockfile.pytask markers: Show all registered markers.pytask profile: Show information about resource consumption.
Options
pytask build¶
Collect tasks, execute them and report the results.
Usage
pytask build [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
--capture [fd|no|sys|tee-sys]Per task capturing method.
Default: fd
Accepted values: fd, no, sys, tee-sys--database-url TEXTUrl to the database.
--debug-pytaskTrace all function calls in the plugin framework.
Default: false
--disable-warningsDisables the summary for warnings.
Default: false
--dry-runPerform a dry-run.
Default: false
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--explainExplain why tasks need to be executed by showing what changed.
Default: false
-f, --forceExecute a task even if it succeeded successfully before.
Default: false
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
-k EXPRESSIONSelect tasks via expressions on task ids.
--log-cli / --no-log-cliEnable live log display during task execution.
Default: --no-log-cli
--log-cli-date-format TEXTLog date format used by the logging module for live logs.
--log-cli-format TEXTLog format used by the logging module for live logs.
--log-cli-level LEVELCLI logging level.
--log-date-format TEXTLog date format used by the logging module.
Default: %H:%M:%S
--log-file TEXTPath to a file where logging will be written.
--log-file-date-format TEXTLog date format used by the logging module for the log file.
--log-file-format TEXTLog format used by the logging module for the log file.
--log-file-level LEVELLog file logging level.
--log-file-mode [w|a]Log file open mode.
Default: w
Accepted values: w, a--log-format TEXTLog format used by the logging module.
Default: %(levelname)-8s %(name)s:%(filename)s:%(lineno)d %(message)s
--log-level LEVELLevel of messages to catch/display. Not set by default, so it depends on the logger configuration.
-m MARKER_EXPRESSIONSelect tasks via marker expressions.
--max-failures FLOAT RANGEStop after some failures.
Default: inf
--n-entries-in-table INTEGER RANGEHow many entries to display in the table during the execution. Tasks which are running are always displayed.
Default: 15
--pdbStart the interactive debugger on errors.
Default: false
--pdbcls module_name:class_nameStart a custom debugger on errors. For example: --pdbcls=IPython.terminal.debugger:TerminalPdb
-sShortcut for --capture=no.
Default: false
--show-capture [no|stdout|stderr|log|all]Choose which captured output should be shown for failed tasks.
Default: all
Accepted values: no, stdout, stderr, log, all--show-errors-immediatelyShow errors with tracebacks as soon as the task fails.
Default: false
--show-localsShow local variables in tracebacks.
Default: false
--show-traceback / --show-no-tracebackChoose whether tracebacks should be displayed or not.
Default: --show-traceback
--sort-table / --do-not-sort-tableSort the table of tasks at the end of the execution.
Default: --sort-table
--strict-markersRaise errors for unknown markers.
Default: false
--traceEnter debugger in the beginning of each task.
Default: false
-v, --verbose INTEGER RANGEMake pytask verbose (>= 0) or quiet (= 0).
Default: 1
-x, --stop-after-first-failureStop after the first failure.
Default: false
--helpShow this message and exit.
pytask clean¶
Clean the provided paths by removing files unknown to pytask.
Usage
pytask clean [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
-d, --directoriesRemove whole directories.
Default: false
--database-url TEXTUrl to the database.
-e, --exclude PATTERNA filename pattern to exclude files from the cleaning process.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
-k EXPRESSIONSelect tasks via expressions on task ids.
-m MARKER_EXPRESSIONSelect tasks via marker expressions.
--mode [dry-run|force|interactive]Choose 'dry-run' to print the paths of files/directories which would be removed, 'interactive' for a confirmation prompt for every path, and 'force' to remove all unknown paths at once.
Default: dry-run
Accepted values: dry-run, force, interactive-q, --quietDo not print the names of the removed paths.
Default: false
--strict-markersRaise errors for unknown markers.
Default: false
--helpShow this message and exit.
pytask collect¶
Collect tasks and report information about them.
Usage
pytask collect [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
--database-url TEXTUrl to the database.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
-k EXPRESSIONSelect tasks via expressions on task ids.
-m MARKER_EXPRESSIONSelect tasks via marker expressions.
--nodesShow a task's dependencies and products.
Default: false
--strict-markersRaise errors for unknown markers.
Default: false
--helpShow this message and exit.
pytask dag¶
Create a visualization of the directed acyclic graph.
Usage
pytask dag [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
--database-url TEXTUrl to the database.
--hook-module TEXTPath to a Python module that contains hook implementations.
-l, --layout TEXTThe layout determines the structure of the graph. Here you find an overview of all available layouts: https://graphviz.org/docs/layouts.
Default: dot
-o, --output-path FILEThe output path of the visualization. The format is inferred from the file extension.
Default: dag.pdf
-r, --rank-direction [TB|LR|BT|RL]The direction of the directed graph. It can be ordered from top to bottom, TB, left to right, LR, bottom to top, BT, or right to left, RL.
Default: TB
Accepted values: TB, LR, BT, RL--helpShow this message and exit.
pytask lock¶
Inspect and update recorded task state in the lockfile.
Usage
pytask lock [OPTIONS] COMMAND [ARGS]...
Commands
pytask lock accept: Accept the current state for selected tasks and their ancestors.pytask lock clean: Remove stale lockfile entries which no longer correspond to collected tasks.pytask lock reset: Remove recorded state for selected tasks.
Options
--helpShow this message and exit.
pytask lock accept¶
Accept the current state for selected tasks and their ancestors.
Usage
pytask lock accept [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-y, --yesApply the changes without prompting for confirmation.
Default: false
--dry-runShow which recorded states would be updated without writing changes.
Default: false
--strict-markersRaise errors for unknown markers.
Default: false
-m MARKER_EXPRESSIONSelect tasks via marker expressions.
-k EXPRESSIONSelect tasks via expressions on task ids.
-c, --config FILEPath to configuration file.
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--helpShow this message and exit.
pytask lock clean¶
Remove stale lockfile entries which no longer correspond to collected tasks.
Usage
pytask lock clean [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-y, --yesApply the changes without prompting for confirmation.
Default: false
--dry-runShow which stale entries would be removed without writing changes.
Default: false
-c, --config FILEPath to configuration file.
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--helpShow this message and exit.
pytask lock reset¶
Remove recorded state for selected tasks.
Usage
pytask lock reset [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-y, --yesApply the changes without prompting for confirmation.
Default: false
--dry-runShow which recorded states would be removed without writing changes.
Default: false
--strict-markersRaise errors for unknown markers.
Default: false
-m MARKER_EXPRESSIONSelect tasks via marker expressions.
-k EXPRESSIONSelect tasks via expressions on task ids.
-c, --config FILEPath to configuration file.
--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--helpShow this message and exit.
pytask markers¶
Show all registered markers.
Usage
pytask markers [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
--hook-module TEXTPath to a Python module that contains hook implementations.
--helpShow this message and exit.
pytask profile¶
Show information about resource consumption.
Usage
pytask profile [OPTIONS] [PATHS]...
Arguments
[PATHS]...Paths where pytask looks for task files and configuration.
Options
-c, --config FILEPath to configuration file.
--database-url TEXTUrl to the database.
--editor-url-scheme TEXTUse file, vscode, pycharm or a custom url scheme to add URLs to task ids to quickly jump to the task definition. Use no_link to disable URLs.
Default: file
--export [no|json|csv]Export the profile in the specified format.
Default: no
Accepted values: no, json, csv--hook-module TEXTPath to a Python module that contains hook implementations.
--ignore TEXTA pattern to ignore files or directories. Refer to 'pathlib.Path.match' for more info.
--helpShow this message and exit.