1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/proc_ioports.md
2024-03-14 22:46:52 -07:00

1.6 KiB

Home

jc.parsers.proc_ioports

jc - JSON Convert /proc/ioports file parser

Usage (cli):

$ cat /proc/ioports | jc --proc

or

$ jc /proc/ioports

or

$ cat /proc/ioports | jc --proc-ioports

Usage (module):

import jc
result = jc.parse('proc', proc_ioports_file)

or

import jc
result = jc.parse('proc_ioports', proc_ioports_file)

Schema:

[
  {
    "start":                   string,
    "end":                     string,
    "device":                  string
  }
]

Examples:

$ cat /proc/ioports | jc --proc -p
[
  {
    "start": "0000",
    "end": "0cf7",
    "device": "PCI Bus 0000:00"
  },
  {
    "start": "0000",
    "end": "001f",
    "device": "dma1"
  },
  {
    "start": "0020",
    "end": "0021",
    "device": "PNP0001:00"
  },
  ...
]

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

Source: jc/parsers/proc_ioports.py

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