1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00
Files
jc/docs/parsers/lspci.md
2022-10-21 12:45:19 -07:00

1.1 KiB

Home

jc.parsers.lspci

jc - JSON Convert lspci -mmv command output parser

This parser supports the following lspci options:

  • -mmv
  • -nmmv
  • -nnmmv

Usage (cli):

$ lspci -nnmmv | jc --lspci

or

$ jc lspci -nnmmv

Usage (module):

import jc
result = jc.parse('lspci', lspci_command_output)

Schema:

[
  {
    "lspci":     string,
    "bar":     boolean,
    "baz":     integer
  }
]

Examples:

$ lspci | jc --lspci -p
[]

$ lspci | jc --lspci -p -r
[]

parse

def parse(data: str,
          raw: bool = False,
          quiet: bool = False) -> List[JSONDictType]

Main text parsing function

Parameters:

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

Returns:

List of Dictionaries. Raw or processed structured data.

Parser Information

Compatibility: linux

Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)