module documentation

CLI definitions, parsing, and entry points.

After argument processing, these call into the dumpers functions to get the job done.

Class NestedTextTo Convert NestedText to another format.
Class PrintShellCompletion Print completion code for the given shell.
Class ToNestedText Convert another format to NestedText.
Class ToNestedTextTo Convert another format to another format, by way of NestedText.
Class WithFromSwitch Mixin for adding the -f/--from switch.
Constant FORMATS Undocumented
Constant SUBCOMMANDS_NT2_NAMES Undocumented
Variable SUBCOMMANDS_2NT Undocumented
Variable SUBCOMMANDS_NT2 Undocumented
Function _determine_2nt_subcommand Return the appropriate 2nt subcommand for the input file and from_format switch value.
Function _to_nested_text_to_with_stdin_as_file Undocumented

Undocumented

Value
[import_module(f"nt2.formats.{fmt.split('.', 1)[0]}") for fmt in resources.conte
nts('nt2.formats') if fmt not in 'nestedtext.py' and (not fmt.startswith('__'))]
SUBCOMMANDS_NT2_NAMES = (source)

Undocumented

Value
sorted(SUBCOMMANDS_NT2_NAMES)
SUBCOMMANDS_2NT = (source)

Undocumented

SUBCOMMANDS_NT2 = (source)

Undocumented

def _determine_2nt_subcommand(from_format: str | None, data_file: LocalPath | None = None) -> SubcommandOfToNestedText: (source)

Return the appropriate 2nt subcommand for the input file and from_format switch value.

Parameters
from_format:str | NoneThe -f/--from switch value.
data_file:LocalPath | NoneThe input file to determine the 2nt subcommand for.
Returns
SubcommandOfToNestedTextThe appropriate 2nt subcommand for the input file and -f/--from switch value.
Raises
NTTErrorIf the subcommand cannot be determined.
def _to_nested_text_to_with_stdin_as_file(from_format: str | None, to_format: str): (source)

Undocumented