Main functions to be called by the UI Application classes, after CLI option parsing.
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 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 | 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 |
Function | _dump |
Undocumented |
Function | _require |
If TOML support is not installed, raise an exception. |
Function | _syntax |
Print a syntax-highlighted rendering of the content to terminal. |
Read JSON from stdin or input_files, and send NestedText to stdout.
Parameters | |
*inputLocalPath | LocalPaths with JSON content. |
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 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. |
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. |
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 JSON, with color if interactive, to stdout.
Parameters | |
data:dict | list | A dict or list 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 | |
dict | list | Parsed JSON data as a dict or list (usually the former). |
Raises | |
JSONDecodeError | Unable to parse content as JSON or JSONLines. |
Pretty-print the data as NestedText, with color if interactive, to stdout.
Parameters | |
data:dict | list | A dict or list to dump as NestedText. |
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 a dict or list of strs. |
Pretty-print the data as TOML, with color if interactive, to stdout.
Parameters | |
data:dict | A dict to dump as TOML. |
Pretty-print the data as YAML, with color if interactive, to stdout.
Parameters | |
data:dict | list | A dict or list to dump as YAML. |
Raises | |
Exception | Unexpected problem dumping or highlighting data. |
If TOML support is not installed, raise an exception.
Raises | |
ImportError | The libraries for TOML support are absent. |