1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00
Files
jc/docs/parsers/pci_ids.md
Kelly Brazil 25e202a09e doc update
2022-10-08 09:04:21 -07:00

1.1 KiB

Home

jc.parsers.pci_ids

jc - JSON Convert pci.ids file parser

This parser converts the pci.ids database file.

https://raw.githubusercontent.com/pciutils/pciids/master/pci.ids

Usage (cli):

$ cat pci.ids | jc --pci-ids

Usage (module):

import jc
result = jc.parse('pci_ids', pci_ids_file_output)

Schema:

[
  {
    "pci-id":     string,
    "bar":     boolean,
    "baz":     integer
  }
]

Examples:

$ cat pci.ids | jc --pci-id -p
[]

$ cat pci.ids | jc --pci-id -p -r
[]

parse

def parse(data: str, raw: bool = False, quiet: bool = False) -> 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:

Dictionary. Raw or processed structured data.

Parser Information

Compatibility: linux, darwin, cygwin, win32, aix, freebsd

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