1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/lspci.md
Kelly Brazil 25e202a09e doc update
2022-10-08 09:04:21 -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[Dict]

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)