sagetasks package

Subpackages

Submodules

sagetasks.main module

sagetasks.utils module

sagetasks.utils.dedup(x: Sequence) list[source]

Deduplicate elements in a sequence (such as a list).

Parameters

x (Sequence) – List of elements.

Returns

Deduplicated list of elements.

Return type

list

sagetasks.utils.to_prefect_tasks(module_name: str, general_module: str) None[source]

Wrap functions inside a general module as Prefect tasks.

Parameters
  • module_name (str) – Module name.

  • general_module (str) – General submodule name.

sagetasks.utils.to_typer_commands(general_module: str) None[source]

Wrap functions inside a general module as Typer commands.

Most functions being converted into Typer commands have a return value. In Python, that return value can be used for other purposes. At the CLI, this return value isn’t visible by default. Hence, before being passed to Typer, to_typer_commands() wraps each function such that the return value is printed on standard output. For the time being, the print() function from the rich package is being used for colored and formatted output.

Parameters

general_module (str) – General submodule name.

sagetasks.utils.update_dict(base_dict: Mapping, overrides: Mapping) Mapping[source]

Update a dictionary recursively with a set of overrides.

Parameters
  • base_dict (Mapping) – Base dictionary.

  • overrides (Mapping) – Dictionary with overrides.

Raises

ValueError – If there is an attempt to create a new key.

Returns

Updated dictionary.

Return type

Mapping

Module contents