Main functions to be called by the UI Application classes, after CLI option parsing.
Function | dump |
Read HUML from stdin or input_files, and send NestedText to stdout. |
Function | dump |
Read HUML from stdin or input_files, and send a NestedText schema to stdout. |
Function | dump |
Read JSON from stdin or input_files, and send NestedText to stdout. |
Function | dump |
Read JSON from stdin or input_files, and send a NestedText schema to stdout. |
Function | dump |
Read NestedText from stdin or input_files, and send up-typed HUML to stdout. |
Function | dump |
Read NestedText from stdin or input_files, and send up-typed JSON to stdout. |
Function | dump |
Read NestedText from stdin or input_files, and send up-typed TOML to stdout. |
Function | dump |
Read NestedText from stdin or input_files, and send up-typed YAML to stdout. |
Function | dump |
Read TOML from stdin or input_files, and send NestedText to stdout. |
Function | dump |
Read TOML from stdin or input_files, and send a NestedText schema to stdout. |
Function | dump |
Read YAML from stdin or input_files, and send NestedText to stdout. |
Function | dump |
Read YAML from stdin or input_files, and send a NestedText schema to stdout. |
Function | huml |
Pretty-print the data as HUML, with color if interactive, to stdout. |
Function | jdump |
Pretty-print the data as JSON, with color if interactive, to stdout. |
Function | jloads |
Wrap json.loads so that on failure it tries parsing as JSON Lines. |
Function | ntdump |
Pretty-print the data as NestedText, with color if interactive, to stdout. |
Function | ntload |
Wrap nestedtext.load with convenient configuration for this module. |
Function | tdump |
Pretty-print the data as TOML, with color if interactive, to stdout. |
Function | ydump |
Pretty-print the data as YAML, with color if interactive, to stdout. |
Constant | RICH |
Undocumented |
Constant | YAML |
Undocumented |
Variable | HUML |
Undocumented |
Variable | TOML |
Undocumented |
Function | _ansi |
Return True if it's acceptable to use ANSI escape sequences. |
Function | _dump |
Undocumented |
Function | _require |
If HUML support is not installed, raise an exception. |
Function | _require |
If TOML support is not installed, raise an exception. |
Function | _syntax |
Print a syntax-highlighted rendering of the content to terminal. |
Read HUML from stdin or input_files, and send NestedText to stdout.
Parameters | |
*inputLocalPath | LocalPaths with HUML content. |
inlineint | Maximum line length for inline dictionaries and lists. |
Read HUML from stdin or input_files, and send a NestedText schema to stdout.
Parameters | |
*inputLocalPath | LocalPaths with HUML content. |
Read JSON from stdin or input_files, and send NestedText to stdout.
Parameters | |
*inputLocalPath | LocalPaths with JSON content. |
inlineint | Maximum line length for inline dictionaries and lists. |
Read JSON from stdin or input_files, and send a NestedText schema to stdout.
Parameters | |
*inputLocalPath | LocalPaths with JSON content. |
LocalPath
, bool_paths: Sequence[ str]
= (), null_paths: Sequence[ str]
= (), num_paths: Sequence[ str]
= ()):
(source)
¶
Read NestedText from stdin or input_files, and send up-typed HUML to stdout.
Parameters | |
*inputLocalPath | LocalPaths with NestedText content. |
boolSequence[ | YAMLPath queries whose matches will be casted to bool. |
nullSequence[ | YAMLPath queries whose matches will be casted to None. |
numSequence[ | YAMLPath queries whose matches will be casted to int/float. |
LocalPath
, bool_paths: Sequence[ str]
= (), null_paths: Sequence[ str]
= (), num_paths: Sequence[ str]
= ()):
(source)
¶
Read NestedText from stdin or input_files, and send up-typed JSON to stdout.
Parameters | |
*inputLocalPath | LocalPaths with NestedText content. |
boolSequence[ | YAMLPath queries whose matches will be casted to bool. |
nullSequence[ | YAMLPath queries whose matches will be casted to None. |
numSequence[ | YAMLPath queries whose matches will be casted to int/float. |
LocalPath
, bool_paths: Sequence[ str]
= (), num_paths: Sequence[ str]
= (), date_paths: Sequence[ str]
= ()):
(source)
¶
Read NestedText from stdin or input_files, and send up-typed TOML to stdout.
Parameters | |
*inputLocalPath | LocalPaths with NestedText content. |
boolSequence[ | YAMLPath queries whose matches will be casted to bool. |
numSequence[ | YAMLPath queries whose matches will be casted to int/float. |
dateSequence[ | YAMLPath queries whose matches will be casted to date/datetime/time. |
LocalPath
, bool_paths: Sequence[ str]
= (), null_paths: Sequence[ str]
= (), num_paths: Sequence[ str]
= (), date_paths: Sequence[ str]
= ()):
(source)
¶
Read NestedText from stdin or input_files, and send up-typed YAML to stdout.
Parameters | |
*inputLocalPath | LocalPaths with NestedText content. |
boolSequence[ | YAMLPath queries whose matches will be casted to bool. |
nullSequence[ | YAMLPath queries whose matches will be casted to None. |
numSequence[ | YAMLPath queries whose matches will be casted to int/float. |
dateSequence[ | YAMLPath queries whose matches will be casted to date/datetime. |
Read TOML from stdin or input_files, and send NestedText to stdout.
Parameters | |
*inputLocalPath | LocalPaths with TOML content. |
inlineint | Maximum line length for inline dictionaries and lists. |
Read TOML from stdin or input_files, and send a NestedText schema to stdout.
Parameters | |
*inputLocalPath | LocalPaths with TOML content. |
Read YAML from stdin or input_files, and send NestedText to stdout.
Parameters | |
*inputLocalPath | LocalPaths with YAML content. |
inlineint | Maximum line length for inline dictionaries and lists. |
Read YAML from stdin or input_files, and send a NestedText schema to stdout.
Parameters | |
*inputLocalPath | LocalPaths with YAML content. |
Pretty-print the data as HUML, with color if interactive, to stdout.
Parameters | |
data:JSONData | A JSONData to dump as HUML. |
Pretty-print the data as JSON, with color if interactive, to stdout.
Parameters | |
data:JSONData | A JSONData to dump as JSON. |
Wrap json.loads so that on failure it tries parsing as JSON Lines.
# noqa: DAR401 # noqa: DAR402
Parameters | |
content:str | JSON or JSON Lines content. |
Returns | |
JSONData | Parsed JSON data as a JSON-supported type, usually dict or list. |
Raises | |
JSONDecodeError | Unable to parse content as JSON or JSONLines. |
Wrap nestedtext.load with convenient configuration for this module.
Set top-level type constraint to 'any', and assure the type checker the result is StringyData.
Parameters | |
file:str | Path | TextIO | NestedText file-like object, usually a LocalPath or sys.stdin. |
Returns | |
StringyData | Parsed NestedText data as StringyData. |
Pretty-print the data as TOML, with color if interactive, to stdout.
Parameters | |
data:TOMLHashData | A TOMLHashData to dump as TOML. |
Pretty-print the data as YAML, with color if interactive, to stdout.
Parameters | |
data:YAMLData | A YAMLData to dump as YAML. |
Raises | |
Exception | Unexpected problem dumping or highlighting data. |
Return True if it's acceptable to use ANSI escape sequences.
Returns | |
bool | True if stdout is a terminal OR FORCE_COLOR is set. |
If HUML support is not installed, raise an exception.
Raises | |
ImportError | The libraries for HUML support are absent. |
If TOML support is not installed, raise an exception.
Raises | |
ImportError | The libraries for TOML support are absent. |