The command line interface

This section documents the command line interface of pytask.

pytask

Manage your tasks with pytask.

pytask [OPTIONS] COMMAND [ARGS]...

Options

--version

Show the version and exit.

build

Collect tasks, execute them and report the results.

The default command. pytask collects tasks from the given paths or the current working directory, executes them and reports the results.

pytask build [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

--capture <capture>

Per task capturing method.

Options:

fd | no | sys | tee-sys

--database-url <database_url>

Url to the database.

Default:

sqlite:///.../.pytask/pytask.sqlite3

--debug-pytask

Trace all function calls in the plugin framework.

--disable-warnings

Disables the summary for warnings.

--dry-run

Perform a dry-run.

--editor-url-scheme <editor_url_scheme>

Use 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.

-f, --force

Execute a task even if it succeeded successfully before.

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

--ignore <ignore>

A pattern to ignore files or directories. Refer to ‘pathlib.Path.match’ for more info.

-k <EXPRESSION>

Select tasks via expressions on task ids.

-m <MARKER_EXPRESSION>

Select tasks via marker expressions.

--max-failures <max_failures>

Stop after some failures.

--n-entries-in-table <n_entries_in_table>

How many entries to display in the table during the execution. Tasks which are running are always displayed.

--pdb

Start the interactive debugger on errors.

--pdbcls <module_name:class_name>

Start a custom debugger on errors. For example: –pdbcls=IPython.terminal.debugger:TerminalPdb

-s

Shortcut for –capture=no.

--show-capture <show_capture>

Choose which captured output should be shown for failed tasks.

Options:

no | stdout | stderr | all

--show-errors-immediately

Show errors with tracebacks as soon as the task fails.

--show-locals

Show local variables in tracebacks.

--show-traceback, --show-no-traceback

Choose whether tracebacks should be displayed or not.

--sort-table, --do-not-sort-table

Sort the table of tasks at the end of the execution.

--strict-markers

Raise errors for unknown markers.

--trace

Enter debugger in the beginning of each task.

-v, --verbose <verbose>

Make pytask verbose (>= 0) or quiet (= 0).

-x, --stop-after-first-failure

Stop after the first failure.

Arguments

PATHS

Optional argument(s)

clean

Clean the provided paths by removing files unknown to pytask.

pytask clean [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

-d, --directories

Remove whole directories.

--database-url <database_url>

Url to the database.

Default:

sqlite:///.../.pytask/pytask.sqlite3

-e, --exclude <PATTERN>

A filename pattern to exclude files from the cleaning process.

--editor-url-scheme <editor_url_scheme>

Use 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.

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

--ignore <ignore>

A pattern to ignore files or directories. Refer to ‘pathlib.Path.match’ for more info.

-k <EXPRESSION>

Select tasks via expressions on task ids.

-m <MARKER_EXPRESSION>

Select tasks via marker expressions.

--mode <mode>

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.

Options:

dry-run | force | interactive

-q, --quiet

Do not print the names of the removed paths.

--strict-markers

Raise errors for unknown markers.

Arguments

PATHS

Optional argument(s)

collect

Collect tasks and report information about them.

pytask collect [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

--database-url <database_url>

Url to the database.

Default:

sqlite:///.../.pytask/pytask.sqlite3

--editor-url-scheme <editor_url_scheme>

Use 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.

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

--ignore <ignore>

A pattern to ignore files or directories. Refer to ‘pathlib.Path.match’ for more info.

-k <EXPRESSION>

Select tasks via expressions on task ids.

-m <MARKER_EXPRESSION>

Select tasks via marker expressions.

--nodes

Show a task’s dependencies and products.

--strict-markers

Raise errors for unknown markers.

Arguments

PATHS

Optional argument(s)

dag

Create a visualization of the project’s directed acyclic graph.

pytask dag [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

--database-url <database_url>

Url to the database.

Default:

sqlite:///.../.pytask/pytask.sqlite3

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

-l, --layout <layout>

The layout determines the structure of the graph. Here you find an overview of all available layouts: https://graphviz.org/docs/layouts.

-o, --output-path <output_path>

The output path of the visualization. The format is inferred from the file extension.

-r, --rank-direction <rank_direction>

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.

Options:

TB | LR | BT | RL

Arguments

PATHS

Optional argument(s)

markers

Show all registered markers.

pytask markers [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

Arguments

PATHS

Optional argument(s)

profile

Show information about tasks like runtime and memory consumption of products.

pytask profile [OPTIONS] [PATHS]...

Options

-c, --config <config>

Path to configuration file.

--database-url <database_url>

Url to the database.

Default:

sqlite:///.../.pytask/pytask.sqlite3

--editor-url-scheme <editor_url_scheme>

Use 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.

--export <export>

Export the profile in the specified format.

Options:

no | json | csv

--hook-module <hook_module>

Path to a Python module that contains hook implementations.

--ignore <ignore>

A pattern to ignore files or directories. Refer to ‘pathlib.Path.match’ for more info.

Arguments

PATHS

Optional argument(s)