1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-23 00:29:59 +02:00
Files
jc/docs/parsers/yaml.md
Kelly Brazil bf033239a7 doc update
2020-02-03 16:20:38 -08:00

1.2 KiB

jc.parsers.yaml

jc - JSON CLI output utility YAML Parser

Usage:

specify --yaml as the first argument if the piped input is coming from a YAML file

Compatibility:

'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'

Examples:

$ cat example.yaml | jc --yaml -p
[
    {
        "Description": "This is a YAML document",
        "Number": 42
    },
    {
        "Description": "Yet Another YAML document"
        "Boolean": true
    }
]

info

info(self, /, *args, **kwargs)

process

process(proc_data)

Final processing to conform to the schema.

Parameters:

proc_data:   (dictionary) raw structured data to process

Returns:

List of dictionaries. Each dictionary represents a YAML document:

[
  {
    YAML Document converted to a Dictionary
    See https://pypi.org/project/ruamel.yaml for details
  }
]

parse

parse(data, raw=False, quiet=False)

Main text parsing function

Parameters:

data:        (string)  text data to parse
raw:         (boolean) output preprocessed JSON if True
quiet:       (boolean) suppress warning messages if True

Returns:

List of dictionaries. Raw or processed structured data.