From 605353fdce3b8b5986d20a35d05f7210a6df0730 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Fri, 9 Apr 2021 15:10:38 -0700 Subject: [PATCH] add new docs --- docs/parsers/acpi.md | 99 +++++++-------- docs/parsers/airport.md | 61 ++++------ docs/parsers/airport_s.md | 9 +- docs/parsers/arp.md | 51 +++----- docs/parsers/blkid.md | 93 ++++++-------- docs/parsers/cksum.md | 41 +++---- docs/parsers/crontab.md | 84 ++++++------- docs/parsers/crontab_u.md | 88 ++++++-------- docs/parsers/csv.md | 41 +++---- docs/parsers/date.md | 68 +++++------ docs/parsers/df.md | 59 ++++----- docs/parsers/dig.md | 133 +++++++++----------- docs/parsers/dir.md | 49 +++----- docs/parsers/dmidecode.md | 55 ++++----- docs/parsers/dpkg_l.md | 51 +++----- docs/parsers/du.md | 39 ++---- docs/parsers/env.md | 39 ++---- docs/parsers/file.md | 39 ++---- docs/parsers/finger.md | 57 ++++----- docs/parsers/free.md | 49 +++----- docs/parsers/fstab.md | 47 +++---- docs/parsers/group.md | 47 +++---- docs/parsers/gshadow.md | 51 +++----- docs/parsers/hash.md | 39 ++---- docs/parsers/hashsum.md | 39 ++---- docs/parsers/hciconfig.md | 123 +++++++++---------- docs/parsers/history.md | 39 ++---- docs/parsers/hosts.md | 43 +++---- docs/parsers/id.md | 79 +++++------- docs/parsers/ifconfig.md | 97 ++++++--------- docs/parsers/ini.md | 44 +++---- docs/parsers/iptables.md | 67 ++++------ docs/parsers/iw_scan.md | 40 +++--- docs/parsers/jobs.md | 45 +++---- docs/parsers/kv.md | 17 ++- docs/parsers/last.md | 53 +++----- docs/parsers/ls.md | 118 ++++-------------- docs/parsers/lsblk.md | 115 ++++++++---------- docs/parsers/lsmod.md | 47 +++---- docs/parsers/lsof.md | 55 ++++----- docs/parsers/mount.md | 47 +++---- docs/parsers/netstat.md | 223 ++++++++++++++++------------------ docs/parsers/ntpq.md | 58 ++++----- docs/parsers/passwd.md | 49 +++----- docs/parsers/ping.md | 81 ++++++------ docs/parsers/pip_list.md | 41 +++---- docs/parsers/pip_show.md | 56 ++++----- docs/parsers/ps.md | 69 +++++------ docs/parsers/route.md | 63 ++++------ docs/parsers/rpm_qi.md | 77 +++++------- docs/parsers/shadow.md | 51 +++----- docs/parsers/ss.md | 73 +++++------ docs/parsers/stat.md | 97 +++++++-------- docs/parsers/sysctl.md | 37 ++---- docs/parsers/systemctl.md | 45 +++---- docs/parsers/systemctl_lj.md | 44 +++---- docs/parsers/systemctl_ls.md | 41 +++---- docs/parsers/systemctl_luf.md | 39 ++---- docs/parsers/time.md | 105 +++++++--------- docs/parsers/timedatectl.md | 53 +++----- docs/parsers/tracepath.md | 60 ++++----- docs/parsers/traceroute.md | 69 ++++------- docs/parsers/uname.md | 47 +++---- docs/parsers/upower.md | 145 ++++++++++------------ docs/parsers/uptime.md | 57 ++++----- docs/parsers/w.md | 51 +++----- docs/parsers/wc.md | 43 +++---- docs/parsers/who.md | 55 ++++----- docs/parsers/xml.md | 38 +++--- docs/parsers/yaml.md | 42 +++---- 70 files changed, 1710 insertions(+), 2656 deletions(-) diff --git a/docs/parsers/acpi.md b/docs/parsers/acpi.md index 0e2f918a..3df64cd5 100644 --- a/docs/parsers/acpi.md +++ b/docs/parsers/acpi.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.acpi jc - JSON CLI output utility `acpi` command output parser @@ -15,9 +16,44 @@ Usage (module): import jc.parsers.acpi result = jc.parsers.acpi.parse(acpi_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "type": string, + "id": integer, + "state": string, + "charge_percent": integer, + "until_charged": string, + "until_charged_hours": integer, + "until_charged_minuts": integer, + "until_charged_seconds": integer, + "until_charged_total_seconds": integer, + "charge_remaining": string, + "charge_remaining_hours": integer, + "charge_remaining_minutes": integer, + "charge_remaining_seconds": integer, + "charge_remaining_total_seconds": integer, + "design_capacity_mah": integer, + "last_full_capacity": integer, + "last_full_capacity_percent": integer, + "on-line": boolean, + "mode": string, + "temperature": float, + "temperature_unit": string, + "trip_points": [ + { + "id": integer, + "switches_to_mode": string, + "temperature": float, + "temperature_unit": string + } + ], + "messages": [ + string + ] + } + ] Examples: @@ -194,60 +230,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "type": string, - "id": integer, - "state": string, - "charge_percent": integer, - "until_charged": string, - "until_charged_hours": integer, - "until_charged_minuts": integer, - "until_charged_seconds": integer, - "until_charged_total_seconds": integer, - "charge_remaining": string, - "charge_remaining_hours": integer, - "charge_remaining_minutes": integer, - "charge_remaining_seconds": integer, - "charge_remaining_total_seconds": integer, - "design_capacity_mah": integer, - "last_full_capacity": integer, - "last_full_capacity_percent": integer, - "on-line": boolean, - "mode": string, - "temperature": float, - "temperature_unit": string, - "trip_points": [ - { - "id": integer, - "switches_to_mode": string, - "temperature": float, - "temperature_unit": string - } - ], - "messages": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -266,3 +249,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/airport.md b/docs/parsers/airport.md index 765be260..93a05dcd 100644 --- a/docs/parsers/airport.md +++ b/docs/parsers/airport.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.airport jc - JSON CLI output utility `airport -I` command output parser @@ -17,9 +18,25 @@ Usage (module): import jc.parsers.airport result = jc.parsers.airport.parse(airport_command_output) -Compatibility: +Schema: - 'darwin' + { + "agrctlrssi": integer, + "agrextrssi": integer, + "agrctlnoise": integer, + "agrextnoise": integer, + "state": string, + "op_mode": string, + "lasttxrate": integer, + "maxrate": integer, + "lastassocstatus": integer, + "802_11_auth": string, + "link_auth": string, + "bssid": string, + "ssid": string, + "mcs": integer, + "channel": string + } Examples: @@ -66,41 +83,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "agrctlrssi": integer, - "agrextrssi": integer, - "agrctlnoise": integer, - "agrextnoise": integer, - "state": string, - "op_mode": string, - "lasttxrate": integer, - "maxrate": integer, - "lastassocstatus": integer, - "802_11_auth": string, - "link_auth": string, - "bssid": string, - "ssid": string, - "mcs": integer, - "channel": string - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -119,3 +102,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: darwin + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/airport_s.md b/docs/parsers/airport_s.md index 5c6dc64f..a36e34d2 100644 --- a/docs/parsers/airport_s.md +++ b/docs/parsers/airport_s.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.airport_s jc - JSON CLI output utility `airport -s` command output parser @@ -17,10 +18,6 @@ Usage (module): import jc.parsers.airport_s result = jc.parsers.airport_s.parse(airport_s_command_output) -Compatibility: - - 'darwin' - Examples: $ airport -s | jc --airport-s -p @@ -146,3 +143,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: darwin + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/arp.md b/docs/parsers/arp.md index f6a4330e..a9a32ee1 100644 --- a/docs/parsers/arp.md +++ b/docs/parsers/arp.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.arp jc - JSON CLI output utility `arp` command output parser @@ -17,9 +18,20 @@ Usage (module): import jc.parsers.arp result = jc.parsers.arp.parse(arp_command_output) -Compatibility: +Schema: - 'linux', 'aix', 'freebsd', 'darwin' + [ + { + "name": string, + "address": string, + "hwtype": string, + "hwaddress": string, + "flags_mask": string, + "iface": string, + "permanent": boolean, + "expires": integer + } + ] Examples: @@ -108,36 +120,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "address": string, - "hwtype": string, - "hwaddress": string, - "flags_mask": string, - "iface": string, - "permanent": boolean, - "expires": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -156,3 +139,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, aix, freebsd, darwin + +Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/blkid.md b/docs/parsers/blkid.md index f4436988..a8738fbb 100644 --- a/docs/parsers/blkid.md +++ b/docs/parsers/blkid.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.blkid jc - JSON CLI output utility `blkid` command output parser @@ -15,9 +16,41 @@ Usage (module): import jc.parsers.blkid result = jc.parsers.blkid.parse(blkid_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "device": string, + "uuid": string, + "type": string, + "usage": string, + "part_entry_scheme": string, + "part_entry_type": string, + "part_entry_flags": string, + "part_entry_number": integer, + "part_entry_offset": integer, + "part_entry_size": integer, + "part_entry_disk": string, + "id_fs_uuid": string, + "id_fs_uuid_enc": string, + "id_fs_version": string, + "id_fs_type": string, + "id_fs_usage": string, + "id_part_entry_scheme": string, + "id_part_entry_type": string, + "id_part_entry_flags": string, + "id_part_entry_number": integer, + "id_part_entry_offset": integer, + "id_part_entry_size": integer, + "id_iolimit_minimum_io_size": integer, + "id_iolimit_physical_sector_size": integer, + "id_iolimit_logical_sector_size": integer, + "id_part_entry_disk": string, + "minimum_io_size": integer, + "physical_sector_size": integer, + "logical_sector_size": integer + } + ] Examples: @@ -90,57 +123,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "device": string, - "uuid": string, - "type": string, - "usage": string, - "part_entry_scheme": string, - "part_entry_type": string, - "part_entry_flags": string, - "part_entry_number": integer, - "part_entry_offset": integer, - "part_entry_size": integer, - "part_entry_disk": string, - "id_fs_uuid": string, - "id_fs_uuid_enc": string, - "id_fs_version": string, - "id_fs_type": string, - "id_fs_usage": string, - "id_part_entry_scheme": string, - "id_part_entry_type": string, - "id_part_entry_flags": string, - "id_part_entry_number": integer, - "id_part_entry_offset": integer, - "id_part_entry_size": integer, - "id_iolimit_minimum_io_size": integer, - "id_iolimit_physical_sector_size": integer, - "id_iolimit_logical_sector_size": integer, - "id_part_entry_disk": string, - "minimum_io_size": integer, - "physical_sector_size": integer, - "logical_sector_size": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -159,3 +142,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/cksum.md b/docs/parsers/cksum.md index dc1aee57..f5b56c59 100644 --- a/docs/parsers/cksum.md +++ b/docs/parsers/cksum.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.cksum jc - JSON CLI output utility `cksum` command output parser @@ -19,9 +20,15 @@ Usage (module): import jc.parsers.cksum result = jc.parsers.cksum.parse(cksum_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "filename": string, + "checksum": integer, + "blocks": integer + } + ] Examples: @@ -50,31 +57,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filename": string, - "checksum": integer, - "blocks": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -93,3 +76,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/crontab.md b/docs/parsers/crontab.md index 0b9507d1..7c390176 100644 --- a/docs/parsers/crontab.md +++ b/docs/parsers/crontab.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.crontab jc - JSON CLI output utility `crontab -l` command output and crontab file parser @@ -17,9 +18,36 @@ Usage (module): import jc.parsers.crontab result = jc.parsers.crontab.parse(crontab_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + { + "variables": [ + "name": string, + "value": string + ], + "schedule": [ + { + "occurrence" string, + "minute": [ + string + ], + "hour": [ + string + ], + "day_of_month": [ + string + ], + "month": [ + string + ], + "day_of_week": [ + string + ], + "occurrence": string, + "command": string + } + ] + } Examples: @@ -145,53 +173,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "variables": [ - "name": string, - "value": string - ], - "schedule": [ - { - "occurrence" string, - "minute": [ - string - ], - "hour": [ - string - ], - "day_of_month": [ - string - ], - "month": [ - string - ], - "day_of_week": [ - string - ], - "occurrence": string, - "command": string - } - ] - } - - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -210,3 +192,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/crontab_u.md b/docs/parsers/crontab_u.md index ef2523f7..b209a72c 100644 --- a/docs/parsers/crontab_u.md +++ b/docs/parsers/crontab_u.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.crontab_u jc - JSON CLI output utility `crontab -l` command output and crontab file parser @@ -13,9 +14,37 @@ Usage (module): import jc.parsers.crontab_u result = jc.parsers.crontab_u.parse(crontab_u_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + { + "variables": [ + "name": string, + "value": string + ], + "schedule": [ + { + "occurrence" string, + "minute": [ + string + ], + "hour": [ + string + ], + "day_of_month": [ + string + ], + "month": [ + string + ], + "day_of_week": [ + string + ], + "occurrence": string, + "user": string, + "command": string + } + ] + } Examples: @@ -136,60 +165,11 @@ Examples: } - - ## info ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "variables": [ - "name": string, - "value": string - ], - "schedule": [ - { - "occurrence" string, - "minute": [ - string - ], - "hour": [ - string - ], - "day_of_month": [ - string - ], - "month": [ - string - ], - "day_of_week": [ - string - ], - "occurrence": string, - "user": string, - "command": string - } - ] - } - - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -208,3 +188,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/csv.md b/docs/parsers/csv.md index 3e77c079..90d1571c 100644 --- a/docs/parsers/csv.md +++ b/docs/parsers/csv.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.csv jc - JSON CLI output utility `csv` file parser @@ -13,9 +14,16 @@ Usage (module): import jc.parsers.csv result = jc.parsers.csv.parse(csv_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + csv file converted to a Dictionary: https://docs.python.org/3/library/csv.html + + [ + { + "column_name1": string, + "column_name2": string + } + ] Examples: @@ -69,30 +77,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Each Dictionary represents a row in the csv file: - - [ - { - csv file converted to a Dictionary - https://docs.python.org/3/library/csv.html - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -111,3 +96,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/date.md b/docs/parsers/date.md index 9372f96e..e489be92 100644 --- a/docs/parsers/date.md +++ b/docs/parsers/date.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.date jc - JSON CLI output utility `date` command output parser @@ -19,9 +20,29 @@ Usage (module): import jc.parsers.date result = jc.parsers.date.parse(date_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + { + "year": integer, + "month": string, + "month_num": integer, + "day": integer, + "weekday": string, + "weekday_num": integer, + "hour": integer, + "hour_24": integer, + "minute": integer, + "second": integer, + "period": string, + "timezone": string, + "utc_offset": string, # null if timezone field is not UTC + "day_of_year": integer, + "week_of_year": integer, + "iso": string, + "epoch": integer, # naive timestamp + "epoch_utc": integer, # timezone-aware timestamp. Only available if timezone field is UTC + "timezone_aware": boolean # if true, all fields are correctly based on UTC + } Examples: @@ -53,44 +74,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - { - "year": integer, - "month": string, - "month_num": integer, - "day": integer, - "weekday": string, - "weekday_num": integer, - "hour": integer, - "hour_24": integer, - "minute": integer, - "second": integer, - "period": string, - "timezone": string, - "utc_offset": string, # null if timezone field is not UTC - "day_of_year": integer, - "week_of_year": integer, - "iso": string, - "epoch": integer, # naive timestamp - "epoch_utc": integer, # timezone-aware timestamp. Only available if timezone field is UTC - "timezone_aware": boolean # if true, all fields are correctly based on UTC - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -109,3 +93,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 2.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/df.md b/docs/parsers/df.md index f81f842d..7eb225f6 100644 --- a/docs/parsers/df.md +++ b/docs/parsers/df.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.df jc - JSON CLI output utility `df` command output parser @@ -15,9 +16,24 @@ Usage (module): import jc.parsers.df result = jc.parsers.df.parse(df_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + [ + { + "filesystem": string, + "size": string, + "1k_blocks": integer, + "512_blocks": integer, + "used": integer, + "available": integer, + "capacity_percent": integer, + "ifree": integer, + "iused": integer, + "use_percent": integer, + "iused_percent": integer, + "mounted_on": string + } + ] Examples: @@ -84,40 +100,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filesystem": string, - "size": string, - "1k_blocks": integer, - "512_blocks": integer, - "used": integer, - "available": integer, - "capacity_percent": integer, - "ifree": integer, - "iused": integer, - "use_percent": integer, - "iused_percent": integer, - "mounted_on": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -136,3 +119,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/dig.md b/docs/parsers/dig.md index e3ad01e8..bf6ad803 100644 --- a/docs/parsers/dig.md +++ b/docs/parsers/dig.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.dig jc - JSON CLI output utility `dig` command output parser @@ -19,9 +20,61 @@ Usage (module): import jc.parsers.dig result = jc.parsers.dig.parse(dig_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + [ + { + "id": integer, + "opcode": string, + "status": string, + "flags": [ + string + ], + "query_num": integer, + "answer_num": integer, + "authority_num": integer, + "additional_num": integer, + "axfr": [ + { + "name": string, + "class": string, + "type": string, + "ttl": integer, + "data": string + } + ], + "question": { + "name": string, + "class": string, + "type": string + }, + "answer": [ + { + "name": string, + "class": string, + "type": string, + "ttl": integer, + "data": string + } + ], + "authority": [ + { + "name": string, + "class": string, + "type": string, + "ttl": integer, + "data": string + } + ], + "query_time": integer, # in msec + "server": string, + "when": string, + "when_epoch": integer, # naive timestamp if when field is parsable, else null + "when_epoch_utc": integer, # timezone aware timestamp availabe for UTC, else null + "rcvd": integer + "size": string + } + ] Examples: @@ -346,77 +399,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "id": integer, - "opcode": string, - "status": string, - "flags": [ - string - ], - "query_num": integer, - "answer_num": integer, - "authority_num": integer, - "additional_num": integer, - "axfr": [ - { - "name": string, - "class": string, - "type": string, - "ttl": integer, - "data": string - } - ], - "question": { - "name": string, - "class": string, - "type": string - }, - "answer": [ - { - "name": string, - "class": string, - "type": string, - "ttl": integer, - "data": string - } - ], - "authority": [ - { - "name": string, - "class": string, - "type": string, - "ttl": integer, - "data": string - } - ], - "query_time": integer, # in msec - "server": string, - "when": string, - "when_epoch": integer, # naive timestamp if when field is parsable, else null - "when_epoch_utc": integer, # timezone aware timestamp availabe for UTC, else null - "rcvd": integer - "size": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -435,3 +418,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, aix, freebsd, darwin + +Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/dir.md b/docs/parsers/dir.md index d58c693b..f3607377 100644 --- a/docs/parsers/dir.md +++ b/docs/parsers/dir.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.dir jc - JSON CLI output utility `dir` command output parser @@ -23,9 +24,19 @@ Usage (module): import jc.parsers.dir result = jc.parsers.dir.parse(dir_command_output) -Compatibility: +Schema: - 'win32' + [ + { + "date": string, + "time": string, + "epoch": integer, # naive timestamp + "dir": boolean, + "size": integer, + "filename: string, + "parent": string + } + ] Examples: @@ -112,35 +123,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary of Lists) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "date": string, - "time": string, - "epoch": integer, # naive timestamp - "dir": boolean, - "size": integer, - "filename: string, - "parent": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -159,3 +142,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: win32 + +Version 1.1 by Rasheed Elsaleh (rasheed@rebelliondefense.com) diff --git a/docs/parsers/dmidecode.md b/docs/parsers/dmidecode.md index 09746022..62d2a7a6 100644 --- a/docs/parsers/dmidecode.md +++ b/docs/parsers/dmidecode.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.dmidecode jc - JSON CLI output utility `dmidecode` command output parser @@ -15,9 +16,22 @@ Usage (module): import jc.parsers.dmidecode result = jc.parsers.dmidecode.parse(dmidecode_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "handle": string, + "type": integer, + "bytes": integer, + "description": string, + "values": { (null if empty) + "lowercase_no_spaces_keys": string, + "multiline_key_values": [ + string, + ] + } + } + ] Examples: @@ -114,38 +128,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "handle": string, - "type": integer, - "bytes": integer, - "description": string, - "values": { (null if empty) - "lowercase_no_spaces_keys": string, - "multiline_key_values": [ - string, - ] - } - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -164,3 +147,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/dpkg_l.md b/docs/parsers/dpkg_l.md index 2d01f39e..1df626d3 100644 --- a/docs/parsers/dpkg_l.md +++ b/docs/parsers/dpkg_l.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.dpkg_l jc - JSON CLI output utility `dpkg -l` command output parser @@ -19,9 +20,20 @@ Usage (module): import jc.parsers.dpkg result = jc.parsers.dpkg.parse(dpkg_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "codes": string, + "name": string, + "version": string, + "architecture": string, + "description": string, + "desired": string, + "status": string, + "error": string + } + ] Examples: @@ -121,36 +133,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "codes": string, - "name": string, - "version": string, - "architecture": string, - "description": string, - "desired": string, - "status": string, - "error": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -169,3 +152,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/du.md b/docs/parsers/du.md index 06131b41..96b067f4 100644 --- a/docs/parsers/du.md +++ b/docs/parsers/du.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.du jc - JSON CLI output utility `du` command output parser @@ -15,9 +16,14 @@ Usage (module): import jc.parsers.du result = jc.parsers.du.parse(du_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + [ + { + "size": integer, + "name": string + } + ] Examples: @@ -84,30 +90,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "size": integer, - "name": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -126,3 +109,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/env.md b/docs/parsers/env.md index 5e0db774..493a121c 100644 --- a/docs/parsers/env.md +++ b/docs/parsers/env.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.env jc - JSON CLI output utility `env` and `printenv` command output parser @@ -17,9 +18,14 @@ Usage (module): import jc.parsers.env result = jc.parsers.env.parse(env_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + [ + { + "name": string, + "value": string + } + ] Examples: @@ -66,30 +72,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "value": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -109,3 +92,7 @@ Returns: Dictionary of raw structured data or List of Dictionaries of processed structured data +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/file.md b/docs/parsers/file.md index 7f5733e8..6b153b61 100644 --- a/docs/parsers/file.md +++ b/docs/parsers/file.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.file jc - JSON CLI output utility `file` command output parser @@ -15,9 +16,14 @@ Usage (module): import jc.parsers.file result = jc.parsers.file.parse(file_command_output) -Compatibility: +Schema: - 'linux', 'aix', 'freebsd', 'darwin' + [ + { + "filename": string, + "type ": string + } + ] Examples: @@ -59,30 +65,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filename": string, - "type ": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -101,3 +84,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, aix, freebsd, darwin + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/finger.md b/docs/parsers/finger.md index 9e3b60b2..118bbb02 100644 --- a/docs/parsers/finger.md +++ b/docs/parsers/finger.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.finger jc - JSON CLI output utility `finger` command output parser @@ -17,9 +18,23 @@ Usage (module): import jc.parsers.finger result = jc.parsers.finger.parse(finger_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', freebsd' + [ + { + "login": string, + "name": string, + "tty": string, + "idle": string, # null if empty + "login_time": string, + "details": string, + "tty_writeable": boolean, + "idle_minutes": integer, + "idle_hours": integer, + "idle_days": integer, + "total_idle_minutes": integer + } + ] Examples: @@ -78,39 +93,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "login": string, - "name": string, - "tty": string, - "idle": string, # null if empty - "login_time": string, - "details": string, - "tty_writeable": boolean, - "idle_minutes": integer, - "idle_hours": integer, - "idle_days": integer, - "total_idle_minutes": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -129,3 +112,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/free.md b/docs/parsers/free.md index dc99de43..13f5f662 100644 --- a/docs/parsers/free.md +++ b/docs/parsers/free.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.free jc - JSON CLI output utility `free` command output parser @@ -15,9 +16,19 @@ Usage (module): import jc.parsers.free result = jc.parsers.free.parse(free_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "type": string, + "total": integer, + "used": integer, + "free": integer, + "shared": integer, + "buff_cache": integer, + "available": integer + } + ] Examples: @@ -64,35 +75,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "type": string, - "total": integer, - "used": integer, - "free": integer, - "shared": integer, - "buff_cache": integer, - "available": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -111,3 +94,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/fstab.md b/docs/parsers/fstab.md index 4a9e3971..396eefff 100644 --- a/docs/parsers/fstab.md +++ b/docs/parsers/fstab.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.fstab jc - JSON CLI output utility `fstab` file parser @@ -11,9 +12,18 @@ Usage (module): import jc.parsers.fstab result = jc.parsers.fstab.parse(fstab_command_output) -Compatibility: +Schema: - 'linux', 'freebsd' + [ + { + "fs_spec": string, + "fs_file": string, + "fs_vfstype": string, + "fs_mntops": string, + "fs_freq": integer, + "fs_passno": integer + } + ] Examples: @@ -78,34 +88,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "fs_spec": string, - "fs_file": string, - "fs_vfstype": string, - "fs_mntops": string, - "fs_freq": integer, - "fs_passno": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -124,3 +107,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/group.md b/docs/parsers/group.md index b5b95931..a9eb2204 100644 --- a/docs/parsers/group.md +++ b/docs/parsers/group.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.group jc - JSON CLI output utility `/etc/group` file parser @@ -11,9 +12,18 @@ Usage (module): import jc.parsers.group result = jc.parsers.group.parse(group_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + [ + { + "group_name": string, + "password": string, + "gid": integer, + "members": [ + string + ] + } + ] Examples: @@ -102,34 +112,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "group_name": string, - "password": string, - "gid": integer, - "members": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -148,3 +131,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/gshadow.md b/docs/parsers/gshadow.md index 414c27e9..d32dc91e 100644 --- a/docs/parsers/gshadow.md +++ b/docs/parsers/gshadow.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.gshadow jc - JSON CLI output utility `/etc/gshadow` file parser @@ -11,9 +12,20 @@ Usage (module): import jc.parsers.gshadow result = jc.parsers.gshadow.parse(gshadow_file_output) -Compatibility: +Schema: - 'linux', 'aix', 'freebsd' + [ + { + "group_name": string, + "password": string, + "administrators": [ + string + ], + "members": [ + string + ] + } + ] Examples: @@ -68,36 +80,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "group_name": string, - "password": string, - "administrators": [ - string - ], - "members": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -116,3 +99,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/hash.md b/docs/parsers/hash.md index ca9546aa..99ace38f 100644 --- a/docs/parsers/hash.md +++ b/docs/parsers/hash.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.hash jc - JSON CLI output utility `hash` command output parser @@ -11,9 +12,14 @@ Usage (module): import jc.parsers.hash result = jc.parsers.hash.parse(hash_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "command": string, + "hits": integer + } + ] Examples: @@ -34,30 +40,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "command": string, - "hits": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -76,3 +59,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/hashsum.md b/docs/parsers/hashsum.md index 958db927..5bcb6b77 100644 --- a/docs/parsers/hashsum.md +++ b/docs/parsers/hashsum.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.hashsum jc - JSON CLI output utility `hash sum` command output parser @@ -25,9 +26,14 @@ Usage (module): import jc.parsers.hashsum result = jc.parsers.hashsum.parse(md5sum_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "filename": string, + "hash": string, + } + ] Examples: @@ -65,30 +71,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filename": string, - "hash": string, - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -107,3 +90,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/hciconfig.md b/docs/parsers/hciconfig.md index 46c209de..6e6f84a1 100644 --- a/docs/parsers/hciconfig.md +++ b/docs/parsers/hciconfig.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.hciconfig jc - JSON CLI output utility `hciconfig` command output parser @@ -15,9 +16,56 @@ Usage (module): import jc.parsers.hciconfig result = jc.parsers.hciconfig.parse(hciconfig_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "device": string, + "type": string, + "bus": string, + "bd_address": string, + "acl_mtu": integer, + "acl_mtu_packets": integer, + "sco_mtu": integer, + "sco_mtu_packets": integer, + "state": [ + string + ], + "rx_bytes": integer, + "rx_acl": integer, + "rx_sco": integer, + "rx_events": integer, + "rx_errors": integer, + "tx_bytes": integer, + "tx_acl": integer, + "tx_sco": integer, + "tx_commands": integer, + "tx_errors": integer, + "features": [ + string + ], + "packet_type": [ + string + ], + "link_policy": [ + string + ], + "link_mode": [ + string + ], + "name": string, + "class": string, + "service_classes": [ + string # 'Unspecified' is null + ], + "device_class": string, + "hci_version": string, + "hci_revision": string, + "lmp_version": string, + "lmp_subversion": string, + "manufacturer": string + } + ] Examples: @@ -272,72 +320,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "device": string, - "type": string, - "bus": string, - "bd_address": string, - "acl_mtu": integer, - "acl_mtu_packets": integer, - "sco_mtu": integer, - "sco_mtu_packets": integer, - "state": [ - string - ], - "rx_bytes": integer, - "rx_acl": integer, - "rx_sco": integer, - "rx_events": integer, - "rx_errors": integer, - "tx_bytes": integer, - "tx_acl": integer, - "tx_sco": integer, - "tx_commands": integer, - "tx_errors": integer, - "features": [ - string - ], - "packet_type": [ - string - ], - "link_policy": [ - string - ], - "link_mode": [ - string - ], - "name": string, - "class": string, - "service_classes": [ - string # 'Unspecified' is null - ], - "device_class": string, - "hci_version": string, - "hci_revision": string, - "lmp_version": string, - "lmp_subversion": string, - "manufacturer": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -356,3 +339,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/history.md b/docs/parsers/history.md index 744eee91..b2a4ae2d 100644 --- a/docs/parsers/history.md +++ b/docs/parsers/history.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.history jc - JSON CLI output utility `history` command output parser @@ -13,9 +14,14 @@ Usage (module): import jc.parsers.history result = jc.parsers.history.parse(history_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "line": integer, + "command": string + } + ] Examples: @@ -54,30 +60,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "line": integer, - "command": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -97,3 +80,7 @@ Returns: Dictionary of raw structured data or List of Dictionaries of processed structured data +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/hosts.md b/docs/parsers/hosts.md index fa56cfc5..ed652c7b 100644 --- a/docs/parsers/hosts.md +++ b/docs/parsers/hosts.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.hosts jc - JSON CLI output utility `/etc/hosts` file parser @@ -11,9 +12,16 @@ Usage (module): import jc.parsers.hosts result = jc.parsers.hosts.parse(hosts_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + [ + { + "ip": string, + "hostname": [ + string + ] + } + ] Examples: @@ -69,32 +77,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "ip": string, - "hostname": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -113,3 +96,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/id.md b/docs/parsers/id.md index 8afe3b10..d44dd7a4 100644 --- a/docs/parsers/id.md +++ b/docs/parsers/id.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.id jc - JSON CLI output utility `id` command output parser @@ -15,9 +16,34 @@ Usage (module): import jc.parsers.id result = jc.parsers.id.parse(id_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + { + "uid": { + "id": integer, + "name": string + }, + "gid": { + "id": integer, + "name": string + }, + "groups": [ + { + "id": integer, + "name": string + }, + { + "id": integer, + "name": string + } + ], + "context": { + "user": string, + "role": string, + "type": string, + "level": string + } + } Examples: @@ -82,50 +108,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "uid": { - "id": integer, - "name": string - }, - "gid": { - "id": integer, - "name": string - }, - "groups": [ - { - "id": integer, - "name": string - }, - { - "id": integer, - "name": string - } - ], - "context": { - "user": string, - "role": string, - "type": string, - "level": string - } - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -144,3 +127,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ifconfig.md b/docs/parsers/ifconfig.md index 1a2036fc..ef58b50f 100644 --- a/docs/parsers/ifconfig.md +++ b/docs/parsers/ifconfig.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ifconfig jc - JSON CLI output utility `ifconfig` command output parser @@ -17,9 +18,40 @@ Usage (module): import jc.parsers.ifconfig result = jc.parsers.ifconfig.parse(ifconfig_command_output) -Compatibility: +Schema: - 'linux', 'aix', 'freebsd', 'darwin' + [ + { + "name": string, + "flags": integer, + "state": [ + string + ], + "mtu": integer, + "ipv4_addr": string, + "ipv4_mask": string, + "ipv4_bcast": string, + "ipv6_addr": string, + "ipv6_mask": integer, + "ipv6_scope": string, + "mac_addr": string, + "type": string, + "rx_packets": integer, + "rx_bytes": integer, + "rx_errors": integer, + "rx_dropped": integer, + "rx_overruns": integer, + "rx_frame": integer, + "tx_packets": integer, + "tx_bytes": integer, + "tx_errors": integer, + "tx_dropped": integer, + "tx_overruns": integer, + "tx_carrier": integer, + "tx_collisions": integer, + "metric": integer + } + ] Examples: @@ -157,62 +189,7 @@ Examples: ```python info() ``` - - -## IfconfigParser -```python -IfconfigParser(console_output) -``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "flags": integer, - "state": [ - string - ], - "mtu": integer, - "ipv4_addr": string, - "ipv4_mask": string, - "ipv4_bcast": string, - "ipv6_addr": string, - "ipv6_mask": integer, - "ipv6_scope": string, - "mac_addr": string, - "type": string, - "rx_packets": integer, - "rx_bytes": integer, - "rx_errors": integer, - "rx_dropped": integer, - "rx_overruns": integer, - "rx_frame": integer, - "tx_packets": integer, - "tx_bytes": integer, - "tx_errors": integer, - "tx_dropped": integer, - "tx_overruns": integer, - "tx_carrier": integer, - "tx_collisions": integer, - "metric": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -231,3 +208,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, aix, freebsd, darwin + +Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ini.md b/docs/parsers/ini.md index 0d38e819..a0659329 100644 --- a/docs/parsers/ini.md +++ b/docs/parsers/ini.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ini jc - JSON CLI output utility `INI` file parser @@ -15,9 +16,18 @@ Usage (module): import jc.parsers.ini result = jc.parsers.ini.parse(ini_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + ini or key/value document converted to a dictionary - see configparser standard + library documentation for more details. + + Note: Values starting and ending with quotation marks will have the marks removed. + If you would like to keep the quotation marks, use the -r or raw=True argument. + + { + "key1": string, + "key2": string + } Examples: @@ -58,31 +68,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary representing an ini or simple key/value pair document: - - { - ini or key/value document converted to a dictionary - see configparser standard - library documentation for more details. - - Note: Values starting and ending with quotation marks will have the marks removed. - If you would like to keep the quotation marks, use the -r or raw=True argument. - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -101,3 +87,7 @@ Returns: Dictionary representing the ini file +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/iptables.md b/docs/parsers/iptables.md index e4b9467e..e2792c63 100644 --- a/docs/parsers/iptables.md +++ b/docs/parsers/iptables.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.iptables jc - JSON CLI output utility `ipables` command output parser @@ -17,9 +18,28 @@ Usage (module): import jc.parsers.iptables result = jc.parsers.iptables.parse(iptables_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "chain": string, + "rules": [ + { + "num" integer, + "pkts": integer, + "bytes": integer, # converted based on suffix + "target": string, + "prot": string, + "opt": string, # "--" = Null + "in": string, + "out": string, + "source": string, + "destination": string, + "options": string + } + ] + } + ] Examples: @@ -146,44 +166,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "chain": string, - "rules": [ - { - "num" integer, - "pkts": integer, - "bytes": integer, # converted based on suffix - "target": string, - "prot": string, - "opt": string, # "--" = Null - "in": string, - "out": string, - "source": string, - "destination": string, - "options": string - } - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -202,3 +185,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/iw_scan.md b/docs/parsers/iw_scan.md index 58268fae..e36d91fb 100644 --- a/docs/parsers/iw_scan.md +++ b/docs/parsers/iw_scan.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.iw_scan jc - JSON CLI output utility `iw dev scan` command output parser @@ -17,9 +18,15 @@ Usage (module): import jc.parsers.iw-scan result = jc.parsers.iw-scan.parse(iw-scan_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "foo": string/integer/float, # best guess based on value + "bar": string/integer/float, + "baz": string/integer/float + } + ] Examples: @@ -116,30 +123,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - [ - { - "foo": string/integer/float, # best guess based on value - "bar": string/integer/float, - "baz": string/integer/float - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -158,3 +142,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 0.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/jobs.md b/docs/parsers/jobs.md index de3cb74e..d5a5178d 100644 --- a/docs/parsers/jobs.md +++ b/docs/parsers/jobs.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.jobs jc - JSON CLI output utility `jobs` command output parser @@ -17,9 +18,17 @@ Usage (module): import jc.parsers.jobs result = jc.parsers.jobs.parse(jobs_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "job_number": integer, + "pid": integer, + "history": string, + "status": string, + "command": string + } + ] Example: @@ -88,33 +97,7 @@ Example: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "job_number": integer, - "pid": integer, - "history": string, - "status": string, - "command": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -133,3 +116,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/kv.md b/docs/parsers/kv.md index 2ba6e825..f88c182d 100644 --- a/docs/parsers/kv.md +++ b/docs/parsers/kv.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.kv jc - JSON CLI output utility `Key/Value` file parser @@ -6,7 +7,6 @@ Supports files containing simple key/value pairs. Delimiter can be `=` or `:`. M Note: Values starting and ending with quotation marks will have the marks removed. If you would like to keep the quotation marks, use the `-r` command-line argument or the `raw=True` argument in `parse()`. - Usage (cli): $ cat foo.txt | jc --kv @@ -16,9 +16,14 @@ Usage (module): import jc.parsers.kv result = jc.parsers.kv.parse(kv_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + key/value document converted to a dictionary - see configparser standard library documentation for more details. + + { + "key1": string, + "key2": string + } Examples: @@ -46,7 +51,7 @@ Examples: ```python info() ``` - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -67,3 +72,7 @@ Returns: Dictionary representing the key/value file +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/last.md b/docs/parsers/last.md index 8267a3e1..b95ed89d 100644 --- a/docs/parsers/last.md +++ b/docs/parsers/last.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.last jc - JSON CLI output utility `last` and `lastb` command output parser @@ -19,9 +20,21 @@ Usage (module): import jc.parsers.last result = jc.parsers.last.parse(last_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + [ + { + "user": string, + "tty": string, + "hostname": string, + "login": string, + "logout": string, + "duration": string, + "login_epoch": integer, # (naive) available with last -F option + "logout_epoch": integer, # (naive) available with last -F option + "duration_seconds": integer # available with last -F option + } + ] Examples: @@ -93,37 +106,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "user": string, - "tty": string, - "hostname": string, - "login": string, - "logout": string, - "duration": string, - "login_epoch": integer, # (naive) available with last -F option - "logout_epoch": integer, # (naive) available with last -F option - "duration_seconds": integer # available with last -F option - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -142,3 +125,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ls.md b/docs/parsers/ls.md index 1af78f01..a073597c 100644 --- a/docs/parsers/ls.md +++ b/docs/parsers/ls.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ls jc - JSON CLI output utility `ls` and `vdir` command output parser @@ -26,9 +27,22 @@ Usage (module): import jc.parsers.ls result = jc.parsers.ls.parse(ls_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "filename": string, + "flags": string, + "links": integer, + "parent": string, + "owner": string, + "group": string, + "size": integer, + "date": string, + "epoch": integer, # naive timestamp if date field exists and can be converted + "epoch_utc": integer # timezone aware timestamp if date field is in UTC and can be converted + } + ] Examples: @@ -40,12 +54,6 @@ Examples: { "filename": "arch" }, - { - "filename": "awk" - }, - { - "filename": "base64" - }, ... ] @@ -70,15 +78,6 @@ Examples: "size": 62744, "date": "Aug 8 16:14" }, - { - "filename": "arch", - "flags": "-rwxr-xr-x.", - "links": 1, - "owner": "root", - "group": "root", - "size": 33080, - "date": "Aug 19 23:25" - }, ... ] @@ -103,94 +102,15 @@ Examples: "size": "33080", "date": "Aug 19 23:25" }, - { - "filename": "awk", - "link_to": "gawk", - "flags": "lrwxrwxrwx.", - "links": "1", - "owner": "root", - "group": "root", - "size": "4", - "date": "Aug 15 10:53" - }, - { - "filename": "base64", - "flags": "-rwxr-xr-x.", - "links": "1", - "owner": "root", - "group": "root", - "size": "37360", - "date": "Aug 19 23:25" - }, - { - "filename": "basename", - "flags": "-rwxr-xr-x.", - "links": "1", - "owner": "root", - "group": "root", - "size": "29032", - "date": "Aug 19 23:25" - }, - { - "filename": "bash", - "flags": "-rwxr-xr-x.", - "links": "1", - "owner": "root", - "group": "root", - "size": "964600", - "date": "Aug 8 05:06" - }, ... ] - $ ls -l /usr/bin | jc --ls | jq '.[] | select(.size > 50000000)' - { - "filename": "emacs", - "flags": "-r-xr-xr-x", - "links": 1, - "owner": "root", - "group": "wheel", - "size": 117164432, - "date": "May 3 2019" - } - ## info ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filename": string, - "flags": string, - "links": integer, - "parent": string, - "owner": string, - "group": string, - "size": integer, - "date": string, - "epoch": integer, # naive timestamp if date field exists and can be converted - "epoch_utc": integer # timezone aware timestamp if date field is in UTC and can be converted - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -209,3 +129,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/lsblk.md b/docs/parsers/lsblk.md index 016e6dc3..eeb77fad 100644 --- a/docs/parsers/lsblk.md +++ b/docs/parsers/lsblk.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.lsblk jc - JSON CLI output utility `lsblk` command output parser @@ -15,9 +16,52 @@ Usage (module): import jc.parsers.lsblk result = jc.parsers.lsblk.parse(lsblk_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "name": string, + "maj_min": string, + "rm": boolean, + "size": string, + "ro": boolean, + "type": string, + "mountpoint": string, + "kname": string, + "fstype": string, + "label": string, + "uuid": string, + "partlabel": string, + "partuuid": string, + "ra": integer, + "model": string, + "serial": string, + "state": string, + "owner": string, + "group": string, + "mode": string, + "alignment": integer, + "min_io": integer, + "opt_io": integer, + "phy_sec": integer, + "log_sec": integer, + "rota": boolean, + "sched": string, + "rq_size": integer, + "disc_aln": integer, + "disc_gran": string, + "disc_max": string, + "disc_zero": boolean, + "wsame": string, + "wwn": string, + "rand": boolean, + "pkname": string, + "hctl": string, + "tran": string, + "rev": string, + "vendor": string + } + ] Examples: @@ -227,68 +271,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "maj_min": string, - "rm": boolean, - "size": string, - "ro": boolean, - "type": string, - "mountpoint": string, - "kname": string, - "fstype": string, - "label": string, - "uuid": string, - "partlabel": string, - "partuuid": string, - "ra": integer, - "model": string, - "serial": string, - "state": string, - "owner": string, - "group": string, - "mode": string, - "alignment": integer, - "min_io": integer, - "opt_io": integer, - "phy_sec": integer, - "log_sec": integer, - "rota": boolean, - "sched": string, - "rq_size": integer, - "disc_aln": integer, - "disc_gran": string, - "disc_max": string, - "disc_zero": boolean, - "wsame": string, - "wwn": string, - "rand": boolean, - "pkname": string, - "hctl": string, - "tran": string, - "rev": string, - "vendor": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -307,3 +290,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/lsmod.md b/docs/parsers/lsmod.md index 9b0e27df..ede5369c 100644 --- a/docs/parsers/lsmod.md +++ b/docs/parsers/lsmod.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.lsmod jc - JSON CLI output utility `lsmod` command output parser @@ -15,9 +16,18 @@ Usage (module): import jc.parsers.lsmod result = jc.parsers.lsmod.parse(lsmod_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "module": string, + "size": integer, + "used": integer, + "by": [ + string + ] + } + ] Examples: @@ -118,34 +128,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "module": string, - "size": integer, - "used": integer, - "by": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -164,3 +147,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/lsof.md b/docs/parsers/lsof.md index 543abcec..d2bd428b 100644 --- a/docs/parsers/lsof.md +++ b/docs/parsers/lsof.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.lsof jc - JSON CLI output utility `lsof` command output parser @@ -15,9 +16,22 @@ Usage (module): import jc.parsers.lsof result = jc.parsers.lsof.parse(lsof_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "command": string, + "pid": integer, + "tid": integer, + "user": string, + "fd": string, + "type": string, + "device": string, + "size_off": integer, + "node": integer, + "name": string + } + ] Examples: @@ -108,38 +122,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "command": string, - "pid": integer, - "tid": integer, - "user": string, - "fd": string, - "type": string, - "device": string, - "size_off": integer, - "node": integer, - "name": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -158,3 +141,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/mount.md b/docs/parsers/mount.md index 57cd3400..77b6e4b9 100644 --- a/docs/parsers/mount.md +++ b/docs/parsers/mount.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.mount jc - JSON CLI output utility `mount` command output parser @@ -15,9 +16,18 @@ Usage (module): import jc.parsers.mount result = jc.parsers.mount.parse(mount_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + [ + { + "filesystem": string, + "mount_point": string, + "type": string, + "access": [ + string + ] + } + ] Example: @@ -68,34 +78,7 @@ Example: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filesystem": string, - "mount_point": string, - "type": string, - "access": [ - string - ] - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -114,3 +97,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/netstat.md b/docs/parsers/netstat.md index bb5c0763..dea01c4c 100644 --- a/docs/parsers/netstat.md +++ b/docs/parsers/netstat.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.netstat jc - JSON CLI output utility `netstat` command output parser @@ -19,9 +20,106 @@ Usage (module): import jc.parsers.netstat result = jc.parsers.netstat.parse(netstat_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + [ + { + "proto": string, + "recv_q": integer, + "send_q": integer, + "transport_protocol" string, + "network_protocol": string, + "local_address": string, + "local_port": string, + "local_port_num": integer, + "foreign_address": string, + "foreign_port": string, + "foreign_port_num": integer, + "state": string, + "program_name": string, + "pid": integer, + "user": string, + "security_context": string, + "refcnt": integer, + "flags": string, + "type": string, + "inode": integer, + "path": string, + "kind": string, + "address": string, + "unix_inode": string, + "conn": string, + "refs": string, + "nextref": string, + "name": string, + "unit": integer, + "vendor": integer, + "class": integer, + "subcla": integer, + "unix_flags": integer, + "pcbcount": integer, + "rcvbuf": integer, + "sndbuf": integer, + "rxbytes": integer, + "txbytes": integer, + "destination": string, + "gateway": string, + "route_flags": string, + "route_flags_pretty": [ + string, + ] + "route_refs": integer, + "use": integer, + "mtu": integer, + "expire": string, + "genmask": string, + "mss": integer, + "window": integer, + "irtt": integer, + "iface": string, + "metric": integer, + "network": string, + "address": string, + "ipkts": integer, # - = null + "ierrs": integer, # - = null + "idrop": integer, # - = null + "opkts": integer, # - = null + "oerrs": integer, # - = null + "coll": integer, # - = null + "rx_ok": integer, + "rx_err": integer, + "rx_drp": integer, + "rx_ovr": integer, + "tx_ok": integer, + "tx_err": integer, + "tx_drp": integer, + "tx_ovr": integer, + "flg": string, + "ibytes": integer, + "obytes": integer, + "r_mbuf": integer, + "s_mbuf": integer, + "r_clus": integer, + "s_clus": integer, + "r_hiwa": integer, + "s_hiwa": integer, + "r_lowa": integer, + "s_lowa": integer, + "r_bcnt": integer, + "s_bcnt": integer, + "r_bmax": integer, + "s_bmax": integer, + "rexmit": integer, + "ooorcv": integer, + "0_win": integer, + "rexmt": float, + "persist": float, + "keep": float, + "2msl": float, + "delack": float, + "rcvtime": float, + } + ] Examples: @@ -259,122 +357,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "proto": string, - "recv_q": integer, - "send_q": integer, - "transport_protocol" string, - "network_protocol": string, - "local_address": string, - "local_port": string, - "local_port_num": integer, - "foreign_address": string, - "foreign_port": string, - "foreign_port_num": integer, - "state": string, - "program_name": string, - "pid": integer, - "user": string, - "security_context": string, - "refcnt": integer, - "flags": string, - "type": string, - "inode": integer, - "path": string, - "kind": string, - "address": string, - "unix_inode": string, - "conn": string, - "refs": string, - "nextref": string, - "name": string, - "unit": integer, - "vendor": integer, - "class": integer, - "subcla": integer, - "unix_flags": integer, - "pcbcount": integer, - "rcvbuf": integer, - "sndbuf": integer, - "rxbytes": integer, - "txbytes": integer, - "destination": string, - "gateway": string, - "route_flags": string, - "route_flags_pretty": [ - string, - ] - "route_refs": integer, - "use": integer, - "mtu": integer, - "expire": string, - "genmask": string, - "mss": integer, - "window": integer, - "irtt": integer, - "iface": string, - "metric": integer, - "network": string, - "address": string, - "ipkts": integer, - = null - "ierrs": integer, - = null - "idrop": integer, - = null - "opkts": integer, - = null - "oerrs": integer, - = null - "coll": integer, - = null - "rx_ok": integer, - "rx_err": integer, - "rx_drp": integer, - "rx_ovr": integer, - "tx_ok": integer, - "tx_err": integer, - "tx_drp": integer, - "tx_ovr": integer, - "flg": string, - "ibytes": integer, - "obytes": integer, - "r_mbuf": integer, - "s_mbuf": integer, - "r_clus": integer, - "s_clus": integer, - "r_hiwa": integer, - "s_hiwa": integer, - "r_lowa": integer, - "s_lowa": integer, - "r_bcnt": integer, - "s_bcnt": integer, - "r_bmax": integer, - "s_bmax": integer, - "rexmit": integer, - "ooorcv": integer, - "0_win": integer, - "rexmt": float, - "persist": float, - "keep": float, - "2msl": float, - "delack": float, - "rcvtime": float, - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -393,3 +376,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ntpq.md b/docs/parsers/ntpq.md index 313d8b6e..822456b0 100644 --- a/docs/parsers/ntpq.md +++ b/docs/parsers/ntpq.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ntpq jc - JSON CLI output utility `ntpq -p` command output parser @@ -15,9 +16,23 @@ Usage (module): import jc.parsers.ntpq result = jc.parsers.ntpq.parse(ntpq_command_output) -Compatibility: +Schema: - 'linux', 'freebsd' + [ + { + "state": string, # space/~ converted to null + "remote": string, + "refid": string, + "st": integer, + "t": string, + "when": integer, # - converted to null + "poll": integer, + "reach": integer, + "delay": float, + "offset": float, + "jitter": float + }, + ] Examples: @@ -194,40 +209,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "state": string, # space/~ converted to null - "remote": string, - "refid": string, - "st": integer, - "t": string, - "when": integer, # - converted to null - "poll": integer, - "reach": integer, - "delay": float, - "offset": float, - "jitter": float - }, - ] - - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -246,3 +228,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/passwd.md b/docs/parsers/passwd.md index 42ee12bf..52f188e8 100644 --- a/docs/parsers/passwd.md +++ b/docs/parsers/passwd.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.passwd jc - JSON CLI output utility `/etc/passwd` file Parser @@ -11,9 +12,19 @@ Usage (module): import jc.parsers.passwd result = jc.parsers.passwd.parse(passwd_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + [ + { + "username": string, + "password": string, + "uid": integer, + "gid": integer, + "comment": string, + "home": string, + "shell": string + } + ] Examples: @@ -86,35 +97,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "username": string, - "password": string, - "uid": integer, - "gid": integer, - "comment": string, - "home": string, - "shell": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -133,3 +116,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index b2f83a8c..91c14f85 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ping jc - JSON CLI output utility `ping` command output parser @@ -19,9 +20,35 @@ Usage (module): import jc.parsers.ping result = jc.parsers.ping.parse(ping_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + { + "source_ip": string, + "destination_ip": string, + "data_bytes": integer, + "pattern": string, # (null if not set) + "destination": string, + "packets_transmitted": integer, + "packets_received": integer, + "packet_loss_percent": float, + "duplicates": integer, + "round_trip_ms_min": float, + "round_trip_ms_avg": float, + "round_trip_ms_max": float, + "round_trip_ms_stddev": float, + "responses": [ + { + "type": string, # ('reply' or 'timeout') + "timestamp": float, + "bytes": integer, + "response_ip": string, + "icmp_seq": integer, + "ttl": integer, + "time_ms": float, + "duplicate": boolean + } + ] + } Examples: @@ -121,51 +148,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "source_ip": string, - "destination_ip": string, - "data_bytes": integer, - "pattern": string, (null if not set) - "destination": string, - "packets_transmitted": integer, - "packets_received": integer, - "packet_loss_percent": float, - "duplicates": integer, - "round_trip_ms_min": float, - "round_trip_ms_avg": float, - "round_trip_ms_max": float, - "round_trip_ms_stddev": float, - "responses": [ - { - "type": string, ('reply' or 'timeout') - "timestamp": float, - "bytes": integer, - "response_ip": string, - "icmp_seq": integer, - "ttl": integer, - "time_ms": float, - "duplicate": boolean - } - ] - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -184,3 +167,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/pip_list.md b/docs/parsers/pip_list.md index 3e4a24c6..42a22b65 100644 --- a/docs/parsers/pip_list.md +++ b/docs/parsers/pip_list.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.pip_list jc - JSON CLI output utility `pip-list` command output parser @@ -15,9 +16,15 @@ Usage (module): import jc.parsers.pip_list result = jc.parsers.pip_list.parse(pip_list_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + [ + { + "package": string, + "version": string, + "location": string + } + ] Examples: @@ -43,31 +50,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "package": string, - "version": string, - "location": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -86,3 +69,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/pip_show.md b/docs/parsers/pip_show.md index 04ea0cec..2fc00bda 100644 --- a/docs/parsers/pip_show.md +++ b/docs/parsers/pip_show.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.pip_show jc - JSON CLI output utility `pip-show` command output parser @@ -15,9 +16,22 @@ Usage (module): import jc.parsers.pip_show result = jc.parsers.pip_show.parse(pip_show_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + [ + { + "name": string, + "version": string, + "summary": string, + "home_page": string, + "author": string, + "author_email": string, + "license": string, + "location": string, + "requires": string, + "required_by": string + } + ] Examples: @@ -54,39 +68,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "version": string, - "summary": string, - "home_page": string, - "author": string, - "author_email": string, - "license": string, - "location": string, - "requires": string, - "required_by": string - } - ] - - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -105,3 +87,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ps.md b/docs/parsers/ps.md index 2d854823..5b645dc0 100644 --- a/docs/parsers/ps.md +++ b/docs/parsers/ps.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ps jc - JSON CLI output utility `ps` command output parser @@ -19,9 +20,29 @@ Usage (module): import jc.parsers.ps result = jc.parsers.ps.parse(ps_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "uid": string, + "pid": integer, + "ppid": integer, + "c": integer, + "stime": string, + "tty": string, # ? or ?? = Null + "tt": string, # ?? = Null + "time": string, + "cmd": string, + "user": string, + "cpu_percent": float, + "mem_percent": float, + "vsz": integer, + "rss": integer, + "stat": string, + "start": string, + "command": string + } + ] Examples: @@ -188,45 +209,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "uid": string, - "pid": integer, - "ppid": integer, - "c": integer, - "stime": string, - "tty": string, # ? or ?? = Null - "tt": string, # ?? = Null - "time": string, - "cmd": string, - "user": string, - "cpu_percent": float, - "mem_percent": float, - "vsz": integer, - "rss": integer, - "stat": string, - "start": string, - "command": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -245,3 +228,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/route.md b/docs/parsers/route.md index d1d2e5da..74fe454a 100644 --- a/docs/parsers/route.md +++ b/docs/parsers/route.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.route jc - JSON CLI output utility `route` command output parser @@ -15,9 +16,26 @@ Usage (module): import jc.parsers.route result = jc.parsers.route.parse(route_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "destination": string, + "gateway": string, + "genmask": string, + "flags": string, + "flags_pretty": [ + string, + ] + "metric": integer, + "ref": integer, + "use": integer, + "mss": integer, + "window": integer, + "irtt": integer, + "iface": string + } + ] Examples: @@ -95,42 +113,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "destination": string, - "gateway": string, - "genmask": string, - "flags": string, - "flags_pretty": [ - string, - ] - "metric": integer, - "ref": integer, - "use": integer, - "mss": integer, - "window": integer, - "irtt": integer, - "iface": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -149,3 +132,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/rpm_qi.md b/docs/parsers/rpm_qi.md index c2e59b4f..ac0e10c2 100644 --- a/docs/parsers/rpm_qi.md +++ b/docs/parsers/rpm_qi.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.rpm_qi jc - JSON CLI output utility `rpm -qi` command output parser @@ -21,9 +22,33 @@ Usage (module): import jc.parsers.rpm_qi result = jc.parsers.rpm_qi.parse(rpm_qi_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "name": string, + "epoch": integer, + "version": string, + "release": string, + "architecture": string, + "install_date": string, + "group": string, + "size": integer, + "license": string, + "signature": string, + "source_rpm": string, + "build_date": string, + "build_epoch": integer, # naive timestamp + "build_epoch_utc": integer, # Aware timestamp if timezone is UTC + "build_host": string, + "relocations": string, + "packager": string, + "vendor": string, + "url": string, + "summary": string, + "description": string + } + ] Examples: @@ -128,49 +153,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "name": string, - "epoch": integer, - "version": string, - "release": string, - "architecture": string, - "install_date": string, - "group": string, - "size": integer, - "license": string, - "signature": string, - "source_rpm": string, - "build_date": string, - "build_epoch": integer, # naive timestamp - "build_epoch_utc": integer, # Aware timestamp if timezone is UTC - "build_host": string, - "relocations": string, - "packager": string, - "vendor": string, - "url": string, - "summary": string, - "description": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -189,3 +172,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/shadow.md b/docs/parsers/shadow.md index 60196aa1..7c4b7846 100644 --- a/docs/parsers/shadow.md +++ b/docs/parsers/shadow.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.shadow jc - JSON CLI output utility `/etc/shadow` file parser @@ -11,9 +12,20 @@ Usage (module): import jc.parsers.shadow result = jc.parsers.shadow.parse(shadow_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'aix', 'freebsd' + [ + { + "username": string, + "password": string, + "last_changed": integer, + "minimum": integer, + "maximum": integer, + "warn": integer, + "inactive": integer, + "expire": integer + } + ] Examples: @@ -92,36 +104,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "username": string, - "password": string, - "last_changed": integer, - "minimum": integer, - "maximum": integer, - "warn": integer, - "inactive": integer, - "expire": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -140,3 +123,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, aix, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/ss.md b/docs/parsers/ss.md index 4f081e1e..d531672c 100644 --- a/docs/parsers/ss.md +++ b/docs/parsers/ss.md @@ -1,7 +1,10 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.ss jc - JSON CLI output utility `ss` command output parser +Extended information options like -e and -p are not supported and may cause parsing irregularities. + Usage (cli): $ ss | jc --ss @@ -15,13 +18,29 @@ Usage (module): import jc.parsers.ss result = jc.parsers.ss.parse(ss_command_output) -Limitations: +Schema: - Extended information options like -e and -p are not supported and may cause parsing irregularities + Information from https://www.cyberciti.biz/files/ss.html used to define field names -Compatibility: - - 'linux' + [ + { + "netid": string, + "state": string, + "recv_q": integer, + "send_q": integer, + "local_address": string, + "local_port": string, + "local_port_num": integer, + "peer_address": string, + "peer_port": string, + "peer_port_num": integer, + "interface": string, + "link_layer" string, + "channel": string, + "path": string, + "pid": integer + } + ] Examples: @@ -262,45 +281,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "netid": string, - "state": string, - "recv_q": integer, - "send_q": integer, - "local_address": string, - "local_port": string, - "local_port_num": integer, - "peer_address": string, - "peer_port": string, - "peer_port_num": integer, - "interface": string, - "link_layer" string, - "channel": string, - "path": string, - "pid": integer - } - ] - - Information from https://www.cyberciti.biz/files/ss.html used to define field names - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -319,3 +300,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/stat.md b/docs/parsers/stat.md index 99d8cc11..37ba9fd7 100644 --- a/docs/parsers/stat.md +++ b/docs/parsers/stat.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.stat jc - JSON CLI output utility `stat` command output parser @@ -19,9 +20,43 @@ Usage (module): import jc.parsers.stat result = jc.parsers.stat.parse(stat_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + [ + { + "file": string, + "link_to" string, + "size": integer, + "blocks": integer, + "io_blocks": integer, + "type": string, + "device": string, + "inode": integer, + "links": integer, + "access": string, + "flags": string, + "uid": integer, + "user": string, + "gid": integer, + "group": string, + "access_time": string, # - = null + "access_time_epoch": integer, # naive timestamp + "access_time_epoch_utc": integer, # timezone-aware timestamp + "modify_time": string, # - = null + "modify_time_epoch": integer, # naive timestamp + "modify_time_epoch_utc": integer, # timezone-aware timestamp + "change_time": string, # - = null + "change_time_epoch": integer, # naive timestamp + "change_time_epoch_utc": integer, # timezone-aware timestamp + "birth_time": string, # - = null + "birth_time_epoch": integer, # naive timestamp + "birth_time_epoch_utc": integer, # timezone-aware timestamp + "unix_device": integer, + "rdev": integer, + "block_size": integer, + "unix_flags": string + } + ] Examples: @@ -136,59 +171,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "file": string, - "link_to" string, - "size": integer, - "blocks": integer, - "io_blocks": integer, - "type": string, - "device": string, - "inode": integer, - "links": integer, - "access": string, - "flags": string, - "uid": integer, - "user": string, - "gid": integer, - "group": string, - "access_time": string, # - = null - "access_time_epoch": integer, # naive timestamp - "access_time_epoch_utc": integer, # timezone-aware timestamp - "modify_time": string, # - = null - "modify_time_epoch": integer, # naive timestamp - "modify_time_epoch_utc": integer, # timezone-aware timestamp - "change_time": string, # - = null - "change_time_epoch": integer, # naive timestamp - "change_time_epoch_utc": integer, # timezone-aware timestamp - "birth_time": string, # - = null - "birth_time_epoch": integer, # naive timestamp - "birth_time_epoch_utc": integer, # timezone-aware timestamp - "unix_device": integer, - "rdev": integer, - "block_size": integer, - "unix_flags": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -207,3 +190,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/sysctl.md b/docs/parsers/sysctl.md index e167c0c8..a24da65d 100644 --- a/docs/parsers/sysctl.md +++ b/docs/parsers/sysctl.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.sysctl jc - JSON CLI output utility `sysctl -a` command output parser @@ -17,9 +18,13 @@ Usage (module): import jc.parsers.sysctl result = jc.parsers.sysctl.parse(sysctl_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + { + "key1": string/integer/float, # best guess based on value + "key2": string/integer/float, + "key3": string/integer/float + } Examples: @@ -52,29 +57,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "foo": string/integer/float, # best guess based on value - "bar": string/integer/float, - "baz": string/integer/float - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -93,3 +76,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/systemctl.md b/docs/parsers/systemctl.md index af747f2e..050c492f 100644 --- a/docs/parsers/systemctl.md +++ b/docs/parsers/systemctl.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.systemctl jc - JSON CLI output utility `systemctl` command output parser @@ -15,9 +16,17 @@ Usage (module): import jc.parsers.systemctl result = jc.parsers.systemctl.parse(systemctl_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "unit": string, + "load": string, + "active": string, + "sub": string, + "description": string + } + ] Examples: @@ -52,33 +61,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "unit": string, - "load": string, - "active": string, - "sub": string, - "description": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -97,3 +80,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/systemctl_lj.md b/docs/parsers/systemctl_lj.md index 4975256a..ca9fc5d1 100644 --- a/docs/parsers/systemctl_lj.md +++ b/docs/parsers/systemctl_lj.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.systemctl_lj jc - JSON CLI output utility `systemctl list-jobs` command output parser @@ -15,9 +16,16 @@ Usage (module): import jc.parsers.systemctl_lj result = jc.parsers.systemctl_lj.parse(systemctl_lj_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "job": integer, + "unit": string, + "type": string, + "state": string + } + ] Examples: @@ -66,37 +74,11 @@ Examples: ] - ## info ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "job": integer, - "unit": string, - "type": string, - "state": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -115,3 +97,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/systemctl_ls.md b/docs/parsers/systemctl_ls.md index 7c61eea2..9270e007 100644 --- a/docs/parsers/systemctl_ls.md +++ b/docs/parsers/systemctl_ls.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.systemctl_ls jc - JSON CLI output utility `systemctl list-sockets` command output parser @@ -15,9 +16,15 @@ Usage (module): import jc.parsers.systemctl_ls result = jc.parsers.systemctl_ls.parse(systemctl_ls_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "listen": string, + "unit": string, + "activates": string + } + ] Examples: @@ -46,31 +53,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "listen": string, - "unit": string, - "activates": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -89,3 +72,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/systemctl_luf.md b/docs/parsers/systemctl_luf.md index a7253569..8e1bb21a 100644 --- a/docs/parsers/systemctl_luf.md +++ b/docs/parsers/systemctl_luf.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.systemctl_luf jc - JSON CLI output utility `systemctl list-unit-files` command output parser @@ -15,9 +16,14 @@ Usage (module): import jc.parsers.systemctl_luf result = jc.parsers.systemctl_luf.parse(systemctl_luf_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "unit_file": string, + "state": string + } + ] Examples: @@ -43,30 +49,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "unit_file": string, - "state": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -85,3 +68,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/time.md b/docs/parsers/time.md index eb58f8d7..b1d5a6a0 100644 --- a/docs/parsers/time.md +++ b/docs/parsers/time.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.time jc - JSON CLI output utility `/usr/bin/time` command output parser @@ -17,9 +18,47 @@ Usage (module): import jc.parsers.time result = jc.parsers.time.parse(time_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + Source: https://www.freebsd.org/cgi/man.cgi?query=getrusage + https://man7.org/linux/man-pages/man1/time.1.html + + { + "real_time": float, + "user_time": float, + "system_time": float, + "elapsed_time": string, + "elapsed_time_hours": integer, + "elapsed_time_minutes": integer, + "elapsed_time_seconds": integer, + "elapsed_time_centiseconds": integer, + "elapsed_time_total_seconds": float, + "cpu_percent": integer, # null if ? + "average_shared_text_size": integer, + "average_unshared_data_size": integer, + "average_unshared_stack_size": integer, + "average_shared_memory_size": integer, + "maximum_resident_set_size": integer, + "block_input_operations": integer, # aka File system inputs + "block_output_operations": integer, # aka File system outputs + "major_pagefaults": integer, + "minor_pagefaults": integer, + "swaps": integer, + "page_reclaims": integer, + "page_faults": integer, + "messages_sent": integer, + "messages_received": integer, + "signals_received": integer, + "voluntary_context_switches": integer, + "involuntary_context_switches": integer + "command_being_timed": string, + "average_stack_size": integer, + "average_total_size": integer, + "average_resident_set_size": integer, + "signals_delivered": integer, + "page_size": integer, + "exit_status": integer + } Examples: @@ -87,63 +126,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - Source: https://www.freebsd.org/cgi/man.cgi?query=getrusage - https://man7.org/linux/man-pages/man1/time.1.html - - { - "real_time": float, - "user_time": float, - "system_time": float, - "elapsed_time": string, - "elapsed_time_hours": integer, - "elapsed_time_minutes": integer, - "elapsed_time_seconds": integer, - "elapsed_time_centiseconds": integer, - "elapsed_time_total_seconds": float, - "cpu_percent": integer, # null if ? - "average_shared_text_size": integer, - "average_unshared_data_size": integer, - "average_unshared_stack_size": integer, - "average_shared_memory_size": integer, - "maximum_resident_set_size": integer, - "block_input_operations": integer, # aka File system inputs - "block_output_operations": integer, # aka File system outputs - "major_pagefaults": integer, - "minor_pagefaults": integer, - "swaps": integer, - "page_reclaims": integer, - "page_faults": integer, - "messages_sent": integer, - "messages_received": integer, - "signals_received": integer, - "voluntary_context_switches": integer, - "involuntary_context_switches": integer - "command_being_timed": string, - "average_stack_size": integer, - "average_total_size": integer, - "average_resident_set_size": integer, - "signals_delivered": integer, - "page_size": integer, - "exit_status": integer - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -162,3 +145,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/timedatectl.md b/docs/parsers/timedatectl.md index 3b6583c4..c4da08f4 100644 --- a/docs/parsers/timedatectl.md +++ b/docs/parsers/timedatectl.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.timedatectl jc - JSON CLI output utility `timedatectl` command output parser @@ -17,9 +18,21 @@ Usage (module): import jc.parsers.timedatectl result = jc.parsers.timedatectl.parse(timedatectl_command_output) -Compatibility: +Schema: - 'linux' + { + "local_time": string, + "universal_time": string, + "epoch_utc": integer, # timezone-aware timestamp + "rtc_time": string, + "time_zone": string, + "ntp_enabled": boolean, + "ntp_synchronized": boolean, + "system_clock_synchronized": boolean, + "systemd-timesyncd.service_active": boolean, + "rtc_in_local_tz": boolean, + "dst_active": boolean + } Examples: @@ -53,37 +66,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "local_time": string, - "universal_time": string, - "epoch_utc": integer, # timezone-aware timestamp - "rtc_time": string, - "time_zone": string, - "ntp_enabled": boolean, - "ntp_synchronized": boolean, - "system_clock_synchronized": boolean, - "systemd-timesyncd.service_active": boolean, - "rtc_in_local_tz": boolean, - "dst_active": boolean - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -102,3 +85,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/tracepath.md b/docs/parsers/tracepath.md index 68ea3a1c..64791ef6 100644 --- a/docs/parsers/tracepath.md +++ b/docs/parsers/tracepath.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.tracepath jc - JSON CLI output utility `tracepath` command output parser @@ -17,9 +18,24 @@ Usage (module): import jc.parsers.tracepath result = jc.parsers.tracepath.parse(tracepath_command_output) -Compatibility: +Schema: - 'linux' + { + "pmtu": integer, + "forward_hops": integer, + "return_hops": integer, + "hops": [ + { + "ttl": integer, + "guess": boolean, + "host": string, + "reply_ms": float, + "pmtu": integer, + "asymmetric_difference": integer, + "reached": boolean + } + ] + } Examples: @@ -114,45 +130,11 @@ Examples: } - ## info ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "pmtu": integer, - "forward_hops": integer, - "return_hops": integer, - "hops": [ - { - "ttl": integer, - "guess": boolean, - "host": string, - "reply_ms": float, - "pmtu": integer, - "asymmetric_difference": integer, - "reached": boolean - } - ] - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -171,3 +153,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md index 0b67eda0..099f4f35 100644 --- a/docs/parsers/traceroute.md +++ b/docs/parsers/traceroute.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.traceroute jc - JSON CLI output utility `traceroute` command output parser @@ -21,9 +22,26 @@ Usage (module): import jc.parsers.traceroute result = jc.parsers.traceroute.parse(traceroute_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + { + "destination_ip": string, + "destination_name": string, + "hops": [ + { + "hop": integer, + "probes": [ + { + "annotation": string, + "asn": integer, + "ip": string, + "name": string, + "rtt": float + } + ] + } + ] + } Examples: @@ -102,48 +120,7 @@ Examples: ```python info() ``` - - -## Hop -```python -Hop(idx) -``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "destination_ip": string, - "destination_name": string, - "hops": [ - { - "hop": integer, - "probes": [ - { - "annotation": string, - "asn": integer, - "ip": string, - "name": string, - "rtt": float - } - ] - } - ] - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -162,3 +139,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/uname.md b/docs/parsers/uname.md index 7060cc43..09363a76 100644 --- a/docs/parsers/uname.md +++ b/docs/parsers/uname.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.uname jc - JSON CLI output utility `uname -a` command output parser @@ -17,9 +18,18 @@ Usage (module): import jc.parsers.uname result = jc.parsers.uname.parse(uname_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'freebsd' + { + "kernel_name": string, + "node_name": string, + "kernel_release": string, + "operating_system": string, + "hardware_platform": string, + "processor": string, + "machine": string, + "kernel_version": string + } Example: @@ -40,34 +50,7 @@ Example: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "kernel_name": string, - "node_name": string, - "kernel_release": string, - "operating_system": string, - "hardware_platform": string, - "processor": string, - "machine": string, - "kernel_version": string - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -86,3 +69,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, freebsd + +Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/upower.md b/docs/parsers/upower.md index fdb240fd..91e174da 100644 --- a/docs/parsers/upower.md +++ b/docs/parsers/upower.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.upower jc - JSON CLI output utility `upower` command output parser @@ -19,9 +20,67 @@ Usage (module): import jc.parsers.upower result = jc.parsers.upower.parse(upower_command_output) -Compatibility: +Schema: - 'linux' + [ + { + "type": string, + "device_name": string, + "native_path": string, + "power_supply": boolean, + "updated": string, + "updated_epoch": integer, # null if date-time conversion fails + "updated_epoch_utc": integer, # null if date-time conversion fails + "updated_seconds_ago": integer, + "has_history": boolean, + "has_statistics": boolean, + "detail": { + "type": string, + "warning_level": string, # null if none + "online": boolean, + "icon_name": string + "present": boolean, + "rechargeable": boolean, + "state": string, + "energy": float, + "energy_unit": string, + "energy_empty": float, + "energy_empty_unit": string, + "energy_full": float, + "energy_full_unit": string, + "energy_full_design": float, + "energy_full_design_unit": string, + "energy_rate": float, + "energy_rate_unit": string, + "voltage": float, + "voltage_unit": string, + "time_to_full": float, + "time_to_full_unit": string, + "percentage": float, + "capacity": float, + "technology": string + }, + "history_charge": [ + { + "time": integer, + "percent_charged": float, + "status": string + } + ], + "history_rate":[ + { + "time": integer, + "percent_charged": float, + "status": string + } + ], + "daemon_version": string, + "on_battery": boolean, + "lid_is_closed": boolean, + "lid_is_present": boolean, + "critical_action": string + } + ] Examples: @@ -138,83 +197,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "type": string, - "device_name": string, - "native_path": string, - "power_supply": boolean, - "updated": string, - "updated_epoch": integer, # null if date-time conversion fails - "updated_epoch_utc": integer, # null if date-time conversion fails - "updated_seconds_ago": integer, - "has_history": boolean, - "has_statistics": boolean, - "detail": { - "type": string, - "warning_level": string, # null if none - "online": boolean, - "icon_name": string - "present": boolean, - "rechargeable": boolean, - "state": string, - "energy": float, - "energy_unit": string, - "energy_empty": float, - "energy_empty_unit": string, - "energy_full": float, - "energy_full_unit": string, - "energy_full_design": float, - "energy_full_design_unit": string, - "energy_rate": float, - "energy_rate_unit": string, - "voltage": float, - "voltage_unit": string, - "time_to_full": float, - "time_to_full_unit": string, - "percentage": float, - "capacity": float, - "technology": string - }, - "history_charge": [ - { - "time": integer, - "percent_charged": float, - "status": string - } - ], - "history_rate":[ - { - "time": integer, - "percent_charged": float, - "status": string - } - ], - "daemon_version": string, - "on_battery": boolean, - "lid_is_closed": boolean, - "lid_is_present": boolean, - "critical_action": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -233,3 +216,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/uptime.md b/docs/parsers/uptime.md index 0fa7e7c7..146016e7 100644 --- a/docs/parsers/uptime.md +++ b/docs/parsers/uptime.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.uptime jc - JSON CLI output utility `uptime` command output parser @@ -15,9 +16,23 @@ Usage (module): import jc.parsers.uptime result = jc.parsers.uptime.parse(uptime_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + { + "time": string, + "time_hour": integer, + "time_minute": integer, + "time_second": integer, # null if not displayed + "uptime": string, + "uptime_days": integer, + "uptime_hours": integer, + "uptime_minutes": integer, + "uptime_total_seconds": integer, + "users": integer, + "load_1m": float, + "load_5m": float, + "load_15m": float + } Example: @@ -53,39 +68,7 @@ Example: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary. Structured data with the following schema: - - { - "time": string, - "time_hour": integer, - "time_minute": integer, - "time_second": integer, # null if not displayed - "uptime": string, - "uptime_days": integer, - "uptime_hours": integer, - "uptime_minutes": integer, - "uptime_total_seconds": integer, - "users": integer, - "load_1m": float, - "load_5m": float, - "load_15m": float - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -104,3 +87,7 @@ Returns: Dictionary. Raw or processed structured data +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/w.md b/docs/parsers/w.md index 7082229a..63340390 100644 --- a/docs/parsers/w.md +++ b/docs/parsers/w.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.w jc - JSON CLI output utility `w` command output parser @@ -15,9 +16,20 @@ Usage (module): import jc.parsers.w result = jc.parsers.w.parse(w_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "user": string, # '-' = null + "tty": string, # '-' = null + "from": string, # '-' = null + "login_at": string, # '-' = null + "idle": string, # '-' = null + "jcpu": string, + "pcpu": string, + "what": string # '-' = null + } + ] Examples: @@ -94,36 +106,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "user": string, # '-'' = null - "tty": string, # '-'' = null - "from": string, # '-'' = null - "login_at": string, # '-'' = null - "idle": string, # '-'' = null - "jcpu": string, - "pcpu": string, - "what": string # '-'' = null - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -142,3 +125,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/wc.md b/docs/parsers/wc.md index 754e0052..3bc1f5ab 100644 --- a/docs/parsers/wc.md +++ b/docs/parsers/wc.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.wc jc - JSON CLI output utility `wc` command output parser @@ -15,9 +16,16 @@ Usage (module): import jc.parsers.wc result = jc.parsers.wc.parse(wc_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "filename": string, + "lines": integer, + "words": integer, + "characters": integer + } + ] Examples: @@ -49,32 +57,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "filename": string, - "lines": integer, - "words": integer, - "characters": integer - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -93,3 +76,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/who.md b/docs/parsers/who.md index 0dfe152c..8a4f7f40 100644 --- a/docs/parsers/who.md +++ b/docs/parsers/who.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.who jc - JSON CLI output utility `who` command output parser @@ -19,9 +20,22 @@ Usage (module): import jc.parsers.who result = jc.parsers.who.parse(who_command_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' + [ + { + "user": string, + "event": string, + "writeable_tty": string, + "tty": string, + "time": string, + "epoch": integer, # naive timestamp. null if time cannot be converted + "idle": string, + "pid": integer, + "from": string, + "comment": string + } + ] Examples: @@ -121,38 +135,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) raw structured data to process - -Returns: - - List of Dictionaries. Structured data with the following schema: - - [ - { - "user": string, - "event": string, - "writeable_tty": string, - "tty": string, - "time": string, - "epoch": integer, # naive timestamp. null if time cannot be converted - "idle": string, - "pid": integer, - "from": string, - "comment": string - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -171,3 +154,7 @@ Returns: List of Dictionaries. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, aix, freebsd + +Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/xml.md b/docs/parsers/xml.md index ab081418..9393291a 100644 --- a/docs/parsers/xml.md +++ b/docs/parsers/xml.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.xml jc - JSON CLI output utility `XML` file parser @@ -11,9 +12,15 @@ Usage (module): import jc.parsers.xml result = jc.parsers.xml.parse(xml_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + XML Document converted to a Dictionary + See https://github.com/martinblech/xmltodict for details + + { + "key1": string/object, + "key2": string/object + } Examples: @@ -66,28 +73,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (Dictionary) raw structured data to process - -Returns: - - Dictionary representing an XML document: - - { - XML Document converted to a Dictionary - See https://github.com/martinblech/xmltodict for details - } - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -106,3 +92,7 @@ Returns: Dictionary. Raw or processed structured data. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com) diff --git a/docs/parsers/yaml.md b/docs/parsers/yaml.md index ddc808ed..36a6d1f0 100644 --- a/docs/parsers/yaml.md +++ b/docs/parsers/yaml.md @@ -1,3 +1,4 @@ +[Home](https://kellyjonbrazil.github.io/jc/) # jc.parsers.yaml jc - JSON CLI output utility `YAML` file parser @@ -11,9 +12,17 @@ Usage (module): import jc.parsers.yaml result = jc.parsers.yaml.parse(yaml_file_output) -Compatibility: +Schema: - 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' + YAML Document converted to a Dictionary + See https://pypi.org/project/ruamel.yaml for details + + [ + { + "key1": string/int/float/boolean/null/array/object, + "key2": string/int/float/boolean/null/array/object + } + ] Examples: @@ -78,30 +87,7 @@ Examples: ```python info() ``` - - -## process -```python -process(proc_data) -``` - -Final processing to conform to the schema. - -Parameters: - - proc_data: (List of Dictionaries) 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 - } - ] - +Provides parser metadata (version, author, etc.) ## parse ```python @@ -120,3 +106,7 @@ Returns: List of Dictionaries representing the YAML documents. +## Parser Information +Compatibility: linux, darwin, cygwin, win32, aix, freebsd + +Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)