{ } Raw JSON

bundles / traitlets latest / traitlets / config / loader / ArgParseConfigLoader / __init__

function

traitlets.config.loader:ArgParseConfigLoader.__init__

source: /traitlets/config/loader.py:815

Signature

def __init__(self, argv: list[str] | None = None, aliases: dict[str, str] | None = None, flags: dict[str, str] | None = None, log: t.Any = None, classes: list[type[t.Any]] | None = None, subcommands: SubcommandsDict | None = None, *parser_args: t.Any, **parser_kw: t.Any) → None

Summary

Create a config loader for use with argparse.

Parameters

classes : optional, list

The classes to scan for container config-traits and decide for their "multiplicity" when adding them as argparse arguments.

argv : optional, list

If given, used to read command-line arguments from, otherwise sys.argv[1:] is used.

*parser_args : tuple

A tuple of positional arguments that will be passed to the constructor of argparse.ArgumentParser.

**parser_kw : dict

A tuple of keyword arguments that will be passed to the constructor of argparse.ArgumentParser.

aliases : dict of str to str

Dict of aliases to full traitlets names for CLI parsing

flags : dict of str to str

Dict of flags to full traitlets names for CLI parsing

log

Passed to ConfigLoader

Aliases

  • traitlets.config.loader.ArgParseConfigLoader.__init__