law.parser#

Helpers to extract useful information from the luigi command line parser.

full_parser()[source]#

Returns the full ArgumentParser used by the luigi CmdlineParser. The returned instance is cached.

root_task_parser()[source]#

Returns a new ArgumentParser instance that only contains parameter actions of the root task. The returned instance is cached.

global_cmdline_args(exclude=None)[source]#

Returns a dictionary with keys and string values of command line arguments that do not belong to the root task. For bool parameters, such as --local-scheduler, "True" is assumed if they are used as flags, i.e., without a parameter value. The returned dict is cached. exclude can be a list of argument names (with or without the leading "--") to be removed. Example:

global_cmdline_args()
# -> {"--local-scheduler": "True", "--workers": "4"}

global_cmdline_args(exclude=["workers"])
# -> {"--local-scheduler": "True"}
global_cmdline_values()[source]#

Returns a dictionary of global command line arguments (computed with global_cmdline_args()) to their current values. The returnd dictionary is cached. Example:

global_cmdline_values()
# -> {"core_local_scheduler": True}