From 7131c297180bfa195d0209d46fc70ab8e67efe2e Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 5 Aug 2020 13:32:59 -0700 Subject: [PATCH] add module usage info to docs --- docs/parsers/airport.md | 7 ++++++- docs/parsers/airport_s.md | 7 ++++++- docs/parsers/arp.md | 7 ++++++- docs/parsers/crontab.md | 7 ++++++- docs/parsers/crontab_u.md | 7 ++++++- docs/parsers/csv.md | 7 ++++++- docs/parsers/date.md | 7 ++++++- docs/parsers/df.md | 7 ++++++- docs/parsers/dig.md | 7 ++++++- docs/parsers/dmidecode.md | 7 ++++++- docs/parsers/du.md | 7 ++++++- docs/parsers/env.md | 7 ++++++- docs/parsers/file.md | 7 ++++++- docs/parsers/free.md | 7 ++++++- docs/parsers/fstab.md | 7 ++++++- docs/parsers/group.md | 7 ++++++- docs/parsers/gshadow.md | 7 ++++++- docs/parsers/history.md | 7 ++++++- docs/parsers/hosts.md | 7 ++++++- docs/parsers/id.md | 7 ++++++- docs/parsers/ifconfig.md | 7 ++++++- docs/parsers/ini.md | 7 ++++++- docs/parsers/iptables.md | 7 ++++++- docs/parsers/jobs.md | 7 ++++++- docs/parsers/kv.md | 7 ++++++- docs/parsers/last.md | 7 ++++++- docs/parsers/ls.md | 7 ++++++- docs/parsers/lsblk.md | 7 ++++++- docs/parsers/lsmod.md | 7 ++++++- docs/parsers/lsof.md | 7 ++++++- docs/parsers/mount.md | 7 ++++++- docs/parsers/netstat.md | 7 ++++++- docs/parsers/ntpq.md | 7 ++++++- docs/parsers/passwd.md | 7 ++++++- docs/parsers/ping.md | 7 ++++++- docs/parsers/pip_list.md | 7 ++++++- docs/parsers/pip_show.md | 7 ++++++- docs/parsers/ps.md | 7 ++++++- docs/parsers/route.md | 7 ++++++- docs/parsers/shadow.md | 7 ++++++- docs/parsers/ss.md | 7 ++++++- docs/parsers/stat.md | 7 ++++++- docs/parsers/sysctl.md | 7 ++++++- docs/parsers/systemctl.md | 7 ++++++- docs/parsers/systemctl_lj.md | 7 ++++++- docs/parsers/systemctl_ls.md | 7 ++++++- docs/parsers/systemctl_luf.md | 7 ++++++- docs/parsers/timedatectl.md | 7 ++++++- docs/parsers/tracepath.md | 7 ++++++- docs/parsers/traceroute.md | 7 ++++++- docs/parsers/uname.md | 9 +++++++-- docs/parsers/uptime.md | 7 ++++++- docs/parsers/w.md | 7 ++++++- docs/parsers/who.md | 7 ++++++- docs/parsers/xml.md | 7 ++++++- docs/parsers/yaml.md | 7 ++++++- jc/parsers/airport.py | 7 ++++++- jc/parsers/airport_s.py | 7 ++++++- jc/parsers/arp.py | 7 ++++++- jc/parsers/blkid.py | 7 ++++++- jc/parsers/crontab.py | 7 ++++++- jc/parsers/crontab_u.py | 7 ++++++- jc/parsers/csv.py | 7 ++++++- jc/parsers/date.py | 7 ++++++- jc/parsers/df.py | 7 ++++++- jc/parsers/dig.py | 7 ++++++- jc/parsers/dmidecode.py | 7 ++++++- jc/parsers/du.py | 7 ++++++- jc/parsers/env.py | 7 ++++++- jc/parsers/file.py | 7 ++++++- jc/parsers/foo.py | 7 ++++++- jc/parsers/free.py | 7 ++++++- jc/parsers/fstab.py | 7 ++++++- jc/parsers/group.py | 7 ++++++- jc/parsers/gshadow.py | 7 ++++++- jc/parsers/history.py | 7 ++++++- jc/parsers/hosts.py | 7 ++++++- jc/parsers/id.py | 7 ++++++- jc/parsers/ifconfig.py | 7 ++++++- jc/parsers/ini.py | 7 ++++++- jc/parsers/iptables.py | 7 ++++++- jc/parsers/jobs.py | 7 ++++++- jc/parsers/kv.py | 7 ++++++- jc/parsers/last.py | 7 ++++++- jc/parsers/ls.py | 7 ++++++- jc/parsers/lsblk.py | 7 ++++++- jc/parsers/lsmod.py | 7 ++++++- jc/parsers/lsof.py | 7 ++++++- jc/parsers/mount.py | 7 ++++++- jc/parsers/netstat.py | 7 ++++++- jc/parsers/ntpq.py | 7 ++++++- jc/parsers/passwd.py | 7 ++++++- jc/parsers/ping.py | 7 ++++++- jc/parsers/pip_list.py | 7 ++++++- jc/parsers/pip_show.py | 7 ++++++- jc/parsers/ps.py | 7 ++++++- jc/parsers/route.py | 7 ++++++- jc/parsers/shadow.py | 7 ++++++- jc/parsers/ss.py | 7 ++++++- jc/parsers/stat.py | 7 ++++++- jc/parsers/sysctl.py | 7 ++++++- jc/parsers/systemctl.py | 7 ++++++- jc/parsers/systemctl_lj.py | 7 ++++++- jc/parsers/systemctl_ls.py | 7 ++++++- jc/parsers/systemctl_luf.py | 7 ++++++- jc/parsers/timedatectl.py | 7 ++++++- jc/parsers/tracepath.py | 7 ++++++- jc/parsers/traceroute.py | 7 ++++++- jc/parsers/uname.py | 9 +++++++-- jc/parsers/uptime.py | 7 ++++++- jc/parsers/w.py | 7 ++++++- jc/parsers/who.py | 7 ++++++- jc/parsers/xml.py | 7 ++++++- jc/parsers/yaml.py | 7 ++++++- 114 files changed, 686 insertions(+), 116 deletions(-) diff --git a/docs/parsers/airport.md b/docs/parsers/airport.md index b5022cd0..7dc14771 100644 --- a/docs/parsers/airport.md +++ b/docs/parsers/airport.md @@ -2,13 +2,18 @@ # jc.parsers.airport jc - JSON CLI output utility airport -I Parser -Usage: +Usage (cli): specify --airport as the first argument if the piped input is coming from airport -I (OSX) This program can be found at: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport +Usage (module): + + import jc.parsers.airport + result = jc.parsers.airport.parse(airport_command_output) + Compatibility: 'darwin' diff --git a/docs/parsers/airport_s.md b/docs/parsers/airport_s.md index 16fc0db3..d7d6df0d 100644 --- a/docs/parsers/airport_s.md +++ b/docs/parsers/airport_s.md @@ -2,13 +2,18 @@ # jc.parsers.airport_s jc - JSON CLI output utility airport -s Parser -Usage: +Usage (cli): specify --airport as the first argument if the piped input is coming from airport -s (OSX) This program can be found at: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport +Usage (module): + + import jc.parsers.airport_s + result = jc.parsers.airport_s.parse(airport_s_command_output) + Compatibility: 'darwin' diff --git a/docs/parsers/arp.md b/docs/parsers/arp.md index eba14ac0..2ca3ea26 100644 --- a/docs/parsers/arp.md +++ b/docs/parsers/arp.md @@ -2,7 +2,7 @@ # jc.parsers.arp jc - JSON CLI output utility arp Parser -Usage: +Usage (cli): specify --arp as the first argument if the piped input is coming from: @@ -10,6 +10,11 @@ Usage: or arp -a +Usage (module): + + import jc.parsers.arp + result = jc.parsers.arp.parse(arp_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/docs/parsers/crontab.md b/docs/parsers/crontab.md index 03513098..2e630ac3 100644 --- a/docs/parsers/crontab.md +++ b/docs/parsers/crontab.md @@ -2,10 +2,15 @@ # jc.parsers.crontab jc - JSON CLI output utility crontab command and file Parser -Usage: +Usage (cli): specify --crontab as the first argument if the piped input is coming from crontab -l or a crontab file +Usage (module): + + import jc.parsers.crontab + result = jc.parsers.crontab.parse(crontab_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/crontab_u.md b/docs/parsers/crontab_u.md index f58c4559..c506b09e 100644 --- a/docs/parsers/crontab_u.md +++ b/docs/parsers/crontab_u.md @@ -2,10 +2,15 @@ # jc.parsers.crontab_u jc - JSON CLI output utility crontab file Parser -Usage: +Usage (cli): specify --crontab-u as the first argument if the piped input is coming from a crontab file with User specified +Usage (module): + + import jc.parsers.crontab_u + result = jc.parsers.crontab_u.parse(crontab_u_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/csv.md b/docs/parsers/csv.md index f1b1dda4..4f564103 100644 --- a/docs/parsers/csv.md +++ b/docs/parsers/csv.md @@ -2,13 +2,18 @@ # jc.parsers.csv jc - JSON CLI output utility csv Parser -Usage: +Usage (cli): specify --csv as the first argument if the piped input is coming from a csv file. the csv parser will attempt to automatically detect the delimiter character. if the delimiter cannot be detected it will default to comma. the first row of the file must be a header row. +Usage (module): + + import jc.parsers.csv + result = jc.parsers.csv.parse(csv_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/date.md b/docs/parsers/date.md index 44478068..b0d92dc1 100644 --- a/docs/parsers/date.md +++ b/docs/parsers/date.md @@ -2,10 +2,15 @@ # jc.parsers.date jc - JSON CLI output utility date Parser -Usage: +Usage (cli): specify --date as the first argument if the piped input is coming from date +Usage (module): + + import jc.parsers.date + result = jc.parsers.date.parse(date_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/df.md b/docs/parsers/df.md index 414519c0..bf54c8df 100644 --- a/docs/parsers/df.md +++ b/docs/parsers/df.md @@ -2,10 +2,15 @@ # jc.parsers.df jc - JSON CLI output utility df Parser -Usage: +Usage (cli): specify --df as the first argument if the piped input is coming from df +Usage (module): + + import jc.parsers.df + result = jc.parsers.df.parse(df_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/dig.md b/docs/parsers/dig.md index f60c223c..b3429204 100644 --- a/docs/parsers/dig.md +++ b/docs/parsers/dig.md @@ -2,10 +2,15 @@ # jc.parsers.dig jc - JSON CLI output utility dig Parser -Usage: +Usage (cli): Specify --dig as the first argument if the piped input is coming from dig +Usage (module): + + import jc.parsers.dig + result = jc.parsers.dig.parse(dig_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/dmidecode.md b/docs/parsers/dmidecode.md index 9e35ca34..5f672ef4 100644 --- a/docs/parsers/dmidecode.md +++ b/docs/parsers/dmidecode.md @@ -2,10 +2,15 @@ # jc.parsers.dmidecode jc - JSON CLI output utility dmidecode Parser -Usage: +Usage (cli): specify --dmidecode as the first argument if the piped input is coming from dmidecode +Usage (module): + + import jc.parsers.dmidecode + result = jc.parsers.dmidecode.parse(dmidecode_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/du.md b/docs/parsers/du.md index c470cfab..f4a833fd 100644 --- a/docs/parsers/du.md +++ b/docs/parsers/du.md @@ -2,10 +2,15 @@ # jc.parsers.du jc - JSON CLI output utility du Parser -Usage: +Usage (cli): specify --du as the first argument if the piped input is coming from du +Usage (module): + + import jc.parsers.du + result = jc.parsers.du.parse(du_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/env.md b/docs/parsers/env.md index 91daa51d..6abc175b 100644 --- a/docs/parsers/env.md +++ b/docs/parsers/env.md @@ -2,10 +2,15 @@ # jc.parsers.env jc - JSON CLI output utility env Parser -Usage: +Usage (cli): specify --env as the first argument if the piped input is coming from env +Usage (module): + + import jc.parsers.env + result = jc.parsers.env.parse(env_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/file.md b/docs/parsers/file.md index cb2db0ff..2350c443 100644 --- a/docs/parsers/file.md +++ b/docs/parsers/file.md @@ -2,10 +2,15 @@ # jc.parsers.file jc - JSON CLI output utility file command Parser -Usage: +Usage (cli): specify --file as the first argument if the piped input is coming from file. +Usage (module): + + import jc.parsers.file + result = jc.parsers.file.parse(file_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/docs/parsers/free.md b/docs/parsers/free.md index 98de23d9..0dbdb952 100644 --- a/docs/parsers/free.md +++ b/docs/parsers/free.md @@ -2,10 +2,15 @@ # jc.parsers.free jc - JSON CLI output utility free Parser -Usage: +Usage (cli): specify --free as the first argument if the piped input is coming from free +Usage (module): + + import jc.parsers.free + result = jc.parsers.free.parse(free_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/fstab.md b/docs/parsers/fstab.md index 9c80c7bd..d686ffa3 100644 --- a/docs/parsers/fstab.md +++ b/docs/parsers/fstab.md @@ -2,10 +2,15 @@ # jc.parsers.fstab jc - JSON CLI output utility fstab Parser -Usage: +Usage (cli): specify --fstab as the first argument if the piped input is coming from a fstab file +Usage (module): + + import jc.parsers.fstab + result = jc.parsers.fstab.parse(fstab_command_output) + Compatibility: 'linux', 'freebsd' diff --git a/docs/parsers/group.md b/docs/parsers/group.md index 6cc45779..5ee1678c 100644 --- a/docs/parsers/group.md +++ b/docs/parsers/group.md @@ -2,10 +2,15 @@ # jc.parsers.group jc - JSON CLI output utility /etc/group file Parser -Usage: +Usage (cli): specify --group as the first argument if the piped input is coming from /etc/group +Usage (module): + + import jc.parsers.group + result = jc.parsers.group.parse(group_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/gshadow.md b/docs/parsers/gshadow.md index c21edc38..49bb0739 100644 --- a/docs/parsers/gshadow.md +++ b/docs/parsers/gshadow.md @@ -2,10 +2,15 @@ # jc.parsers.gshadow jc - JSON CLI output utility /etc/gshadow file Parser -Usage: +Usage (cli): specify --gshadow as the first argument if the piped input is coming from /etc/gshadow +Usage (module): + + import jc.parsers.gshadow + result = jc.parsers.gshadow.parse(gshadow_file_output) + Compatibility: 'linux', 'aix', 'freebsd' diff --git a/docs/parsers/history.md b/docs/parsers/history.md index 52de5958..8fc0623b 100644 --- a/docs/parsers/history.md +++ b/docs/parsers/history.md @@ -2,10 +2,15 @@ # jc.parsers.history jc - JSON CLI output utility history Parser -Usage: +Usage (cli): specify --history as the first argument if the piped input is coming from history +Usage (module): + + import jc.parsers.history + result = jc.parsers.history.parse(history_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/hosts.md b/docs/parsers/hosts.md index da0b7540..7dbade0c 100644 --- a/docs/parsers/hosts.md +++ b/docs/parsers/hosts.md @@ -2,10 +2,15 @@ # jc.parsers.hosts jc - JSON CLI output utility hosts Parser -Usage: +Usage (cli): specify --hosts as the first argument if the piped input is coming from a hosts file +Usage (module): + + import jc.parsers.hosts + result = jc.parsers.hosts.parse(hosts_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/id.md b/docs/parsers/id.md index 4615049c..828f4420 100644 --- a/docs/parsers/id.md +++ b/docs/parsers/id.md @@ -2,10 +2,15 @@ # jc.parsers.id jc - JSON CLI output utility id Parser -Usage: +Usage (cli): specify --id as the first argument if the piped input is coming from id +Usage (module): + + import jc.parsers.id + result = jc.parsers.id.parse(id_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/ifconfig.md b/docs/parsers/ifconfig.md index 7e60adc4..7bbd6860 100644 --- a/docs/parsers/ifconfig.md +++ b/docs/parsers/ifconfig.md @@ -2,12 +2,17 @@ # jc.parsers.ifconfig jc - JSON CLI output utility ifconfig Parser -Usage: +Usage (cli): specify --ifconfig as the first argument if the piped input is coming from ifconfig no ifconfig options are supported. +Usage (module): + + import jc.parsers.ifconfig + result = jc.parsers.ifconfig.parse(ifconfig_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/docs/parsers/ini.md b/docs/parsers/ini.md index 542cf236..e341f2c4 100644 --- a/docs/parsers/ini.md +++ b/docs/parsers/ini.md @@ -2,12 +2,17 @@ # jc.parsers.ini jc - JSON CLI output utility INI Parser -Usage: +Usage (cli): Specify --ini as the first argument if the piped input is coming from an INI file or any simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. Comment prefix can be '#' or ';'. Comments must be on their own line. +Usage (module): + + import jc.parsers.ini + result = jc.parsers.ini.parse(ini_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/iptables.md b/docs/parsers/iptables.md index 8504b599..b3c25139 100644 --- a/docs/parsers/iptables.md +++ b/docs/parsers/iptables.md @@ -2,12 +2,17 @@ # jc.parsers.iptables jc - JSON CLI output utility ipables Parser -Usage: +Usage (cli): Specify --iptables as the first argument if the piped input is coming from iptables Supports -vLn and --line-numbers for all tables +Usage (module): + + import jc.parsers.iptables + result = jc.parsers.iptables.parse(iptables_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/jobs.md b/docs/parsers/jobs.md index 8332f82a..c140a455 100644 --- a/docs/parsers/jobs.md +++ b/docs/parsers/jobs.md @@ -2,12 +2,17 @@ # jc.parsers.jobs jc - JSON CLI output utility jobs Parser -Usage: +Usage (cli): specify --jobs as the first argument if the piped input is coming from jobs Also supports the -l option +Usage (module): + + import jc.parsers.jobs + result = jc.parsers.jobs.parse(jobs_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/kv.md b/docs/parsers/kv.md index ce75cc0c..95f07c31 100644 --- a/docs/parsers/kv.md +++ b/docs/parsers/kv.md @@ -2,12 +2,17 @@ # jc.parsers.kv jc - JSON CLI output utility Key/Value File Parser -Usage: +Usage (cli): Specify --kv as the first argument if the piped input is coming from a simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. Comment prefix can be '#' or ';'. Comments must be on their own line. +Usage (module): + + import jc.parsers.kv + result = jc.parsers.kv.parse(kv_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/last.md b/docs/parsers/last.md index 677c395b..0c0901b1 100644 --- a/docs/parsers/last.md +++ b/docs/parsers/last.md @@ -2,10 +2,15 @@ # jc.parsers.last jc - JSON CLI output utility last Parser -Usage: +Usage (cli): specify --last as the first argument if the piped input is coming from last or lastb +Usage (module): + + import jc.parsers.last + result = jc.parsers.last.parse(last_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/ls.md b/docs/parsers/ls.md index 3b24c370..a93868af 100644 --- a/docs/parsers/ls.md +++ b/docs/parsers/ls.md @@ -6,7 +6,7 @@ Note: The -l or -b option of ls should be used to correctly parse filenames that Since ls does not encode newlines in filenames when outputting to a pipe it will cause jc to see multiple files instead of a single file if -l or -b is not used. -Usage: +Usage (cli): specify --ls as the first argument if the piped input is coming from ls @@ -18,6 +18,11 @@ Usage: with human readable suffixes will be converted to Null in default view since the parser attempts to convert this field to an integer. +Usage (module): + + import jc.parsers.ls + result = jc.parsers.ls.parse(ls_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/lsblk.md b/docs/parsers/lsblk.md index d2df5fa8..5b7548a9 100644 --- a/docs/parsers/lsblk.md +++ b/docs/parsers/lsblk.md @@ -2,10 +2,15 @@ # jc.parsers.lsblk jc - JSON CLI output utility lsblk Parser -Usage: +Usage (cli): specify --lsblk as the first argument if the piped input is coming from lsblk +Usage (module): + + import jc.parsers.lsblk + result = jc.parsers.lsblk.parse(lsblk_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/lsmod.md b/docs/parsers/lsmod.md index eb9753fc..3bdb63d1 100644 --- a/docs/parsers/lsmod.md +++ b/docs/parsers/lsmod.md @@ -2,10 +2,15 @@ # jc.parsers.lsmod jc - JSON CLI output utility lsmod Parser -Usage: +Usage (cli): specify --lsmod as the first argument if the piped input is coming from lsmod +Usage (module): + + import jc.parsers.lsmod + result = jc.parsers.lsmod.parse(lsmod_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/lsof.md b/docs/parsers/lsof.md index 8ffe8704..8bee4d4f 100644 --- a/docs/parsers/lsof.md +++ b/docs/parsers/lsof.md @@ -2,10 +2,15 @@ # jc.parsers.lsof jc - JSON CLI output utility lsof Parser -Usage: +Usage (cli): specify --lsof as the first argument if the piped input is coming from lsof +Usage (module): + + import jc.parsers.lsof + result = jc.parsers.lsof.parse(lsof_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/mount.md b/docs/parsers/mount.md index 0f0dd30b..a39a7b33 100644 --- a/docs/parsers/mount.md +++ b/docs/parsers/mount.md @@ -2,10 +2,15 @@ # jc.parsers.mount jc - JSON CLI output utility mount Parser -Usage: +Usage (cli): specify --mount as the first argument if the piped input is coming from mount +Usage (module): + + import jc.parsers.mount + result = jc.parsers.mount.parse(mount_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/netstat.md b/docs/parsers/netstat.md index 7068f4ce..393f6152 100644 --- a/docs/parsers/netstat.md +++ b/docs/parsers/netstat.md @@ -2,10 +2,15 @@ # jc.parsers.netstat jc - JSON CLI output utility netstat Parser -Usage: +Usage (cli): Specify --netstat as the first argument if the piped input is coming from netstat +Usage (module): + + import jc.parsers.netstat + result = jc.parsers.netstat.parse(netstat_command_output) + Caveats: - Use of multiple 'l' options is not supported on OSX (e.g. 'netstat -rlll') diff --git a/docs/parsers/ntpq.md b/docs/parsers/ntpq.md index b5ce9725..2594608b 100644 --- a/docs/parsers/ntpq.md +++ b/docs/parsers/ntpq.md @@ -2,10 +2,15 @@ # jc.parsers.ntpq jc - JSON CLI output utility ntpq Parser -Usage: +Usage (cli): specify --ntpq as the first argument if the piped input is coming from ntpq -p +Usage (module): + + import jc.parsers.ntpq + result = jc.parsers.ntpq.parse(ntpq_command_output) + Compatibility: 'linux', 'freebsd' diff --git a/docs/parsers/passwd.md b/docs/parsers/passwd.md index 78d9f103..79a26240 100644 --- a/docs/parsers/passwd.md +++ b/docs/parsers/passwd.md @@ -2,10 +2,15 @@ # jc.parsers.passwd jc - JSON CLI output utility /etc/passwd file Parser -Usage: +Usage (cli): specify --passwd as the first argument if the piped input is coming from /etc/passwd +Usage (module): + + import jc.parsers.passwd + result = jc.parsers.passwd.parse(passwd_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/ping.md b/docs/parsers/ping.md index e9a102f5..dc8f2c49 100644 --- a/docs/parsers/ping.md +++ b/docs/parsers/ping.md @@ -2,12 +2,17 @@ # jc.parsers.ping jc - JSON CLI output utility ping Parser -Usage: +Usage (cli): specify --ping as the first argument if the piped input is coming from ping Note: Use the ping -c (count) option, otherwise data will not be piped to jc. +Usage (module): + + import jc.parsers.ping + result = jc.parsers.ping.parse(ping_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/pip_list.md b/docs/parsers/pip_list.md index e450f7a0..928f0c45 100644 --- a/docs/parsers/pip_list.md +++ b/docs/parsers/pip_list.md @@ -2,10 +2,15 @@ # jc.parsers.pip_list jc - JSON CLI output utility pip-list Parser -Usage: +Usage (cli): specify --pip-list as the first argument if the piped input is coming from pip list +Usage (module): + + import jc.parsers.pip_list + result = jc.parsers.pip_list.parse(pip_list_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/pip_show.md b/docs/parsers/pip_show.md index 222db7ad..f170ce1d 100644 --- a/docs/parsers/pip_show.md +++ b/docs/parsers/pip_show.md @@ -2,10 +2,15 @@ # jc.parsers.pip_show jc - JSON CLI output utility pip-show Parser -Usage: +Usage (cli): specify --pip-show as the first argument if the piped input is coming from pip show +Usage (module): + + import jc.parsers.pip_show + result = jc.parsers.pip_show.parse(pip_show_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/ps.md b/docs/parsers/ps.md index 61648b0f..c4b3bc65 100644 --- a/docs/parsers/ps.md +++ b/docs/parsers/ps.md @@ -2,7 +2,7 @@ # jc.parsers.ps jc - JSON CLI output utility ps Parser -Usage: +Usage (cli): specify --ps as the first argument if the piped input is coming from ps @@ -10,6 +10,11 @@ Usage: - ef - axu +Usage (module): + + import jc.parsers.ps + result = jc.parsers.ps.parse(ps_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/route.md b/docs/parsers/route.md index bdad5dd1..b36643e3 100644 --- a/docs/parsers/route.md +++ b/docs/parsers/route.md @@ -2,10 +2,15 @@ # jc.parsers.route jc - JSON CLI output utility route Parser -Usage: +Usage (cli): specify --route as the first argument if the piped input is coming from route +Usage (module): + + import jc.parsers.route + result = jc.parsers.route.parse(route_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/shadow.md b/docs/parsers/shadow.md index 5dd3ba2d..f0692db1 100644 --- a/docs/parsers/shadow.md +++ b/docs/parsers/shadow.md @@ -2,10 +2,15 @@ # jc.parsers.shadow jc - JSON CLI output utility /etc/shadow file Parser -Usage: +Usage (cli): specify --shadow as the first argument if the piped input is coming from /etc/shadow +Usage (module): + + import jc.parsers.shadow + result = jc.parsers.shadow.parse(shadow_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/docs/parsers/ss.md b/docs/parsers/ss.md index ad82eb79..a6adb12a 100644 --- a/docs/parsers/ss.md +++ b/docs/parsers/ss.md @@ -2,10 +2,15 @@ # jc.parsers.ss jc - JSON CLI output utility ss Parser -Usage: +Usage (cli): specify --ss as the first argument if the piped input is coming from ss +Usage (module): + + import jc.parsers.ss + result = jc.parsers.ss.parse(ss_command_output) + Limitations: Extended information options like -e and -p are not supported and may cause parsing irregularities diff --git a/docs/parsers/stat.md b/docs/parsers/stat.md index 98c9debf..51cb1632 100644 --- a/docs/parsers/stat.md +++ b/docs/parsers/stat.md @@ -2,10 +2,15 @@ # jc.parsers.stat jc - JSON CLI output utility stat Parser -Usage: +Usage (cli): specify --stat as the first argument if the piped input is coming from stat +Usage (module): + + import jc.parsers.stat + result = jc.parsers.stat.parse(stat_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/sysctl.md b/docs/parsers/sysctl.md index 316713b9..78f1d530 100644 --- a/docs/parsers/sysctl.md +++ b/docs/parsers/sysctl.md @@ -2,7 +2,7 @@ # jc.parsers.sysctl jc - JSON CLI output utility sysctl -a Parser -Usage: +Usage (cli): specify --sysctl as the first argument if the piped input is coming from sysctl -a @@ -10,6 +10,11 @@ Usage: will be output. An attempt is made to convert obvious integers and floats. If no conversion is desired, use the -r (raw) option. +Usage (module): + + import jc.parsers.sysctl + result = jc.parsers.sysctl.parse(sysctl_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/systemctl.md b/docs/parsers/systemctl.md index 1b6ae7ad..b062c238 100644 --- a/docs/parsers/systemctl.md +++ b/docs/parsers/systemctl.md @@ -2,10 +2,15 @@ # jc.parsers.systemctl jc - JSON CLI output utility systemctl Parser -Usage: +Usage (cli): specify --systemctl as the first argument if the piped input is coming from systemctl +Usage (module): + + import jc.parsers.systemctl + result = jc.parsers.systemctl.parse(systemctl_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/systemctl_lj.md b/docs/parsers/systemctl_lj.md index c98c5033..0b441a55 100644 --- a/docs/parsers/systemctl_lj.md +++ b/docs/parsers/systemctl_lj.md @@ -2,10 +2,15 @@ # jc.parsers.systemctl_lj jc - JSON CLI output utility systemctl-lj Parser -Usage: +Usage (cli): specify --systemctl-lj as the first argument if the piped input is coming from systemctl list-jobs +Usage (module): + + import jc.parsers.systemctl_lj + result = jc.parsers.systemctl_lj.parse(systemctl_lj_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/systemctl_ls.md b/docs/parsers/systemctl_ls.md index d40adce2..ae1bd9e8 100644 --- a/docs/parsers/systemctl_ls.md +++ b/docs/parsers/systemctl_ls.md @@ -2,10 +2,15 @@ # jc.parsers.systemctl_ls jc - JSON CLI output utility systemctl-ls Parser -Usage: +Usage (cli): specify --systemctl-ls as the first argument if the piped input is coming from systemctl list-sockets +Usage (module): + + import jc.parsers.systemctl_ls + result = jc.parsers.systemctl_ls.parse(systemctl_ls_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/systemctl_luf.md b/docs/parsers/systemctl_luf.md index 0a09dc17..adb76aa1 100644 --- a/docs/parsers/systemctl_luf.md +++ b/docs/parsers/systemctl_luf.md @@ -2,10 +2,15 @@ # jc.parsers.systemctl_luf jc - JSON CLI output utility systemctl-luf Parser -Usage: +Usage (cli): specify --systemctl-luf as the first argument if the piped input is coming from systemctl list-unit-files +Usage (module): + + import jc.parsers.systemctl_luf + result = jc.parsers.systemctl_luf.parse(systemctl_luf_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/timedatectl.md b/docs/parsers/timedatectl.md index 1e927c90..55ba1d9d 100644 --- a/docs/parsers/timedatectl.md +++ b/docs/parsers/timedatectl.md @@ -2,10 +2,15 @@ # jc.parsers.timedatectl jc - JSON CLI output utility timedatectl Parser -Usage: +Usage (cli): specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status +Usage (module): + + import jc.parsers.timedatectl + result = jc.parsers.timedatectl.parse(timedatectl_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/tracepath.md b/docs/parsers/tracepath.md index 935cbfb9..8217668c 100644 --- a/docs/parsers/tracepath.md +++ b/docs/parsers/tracepath.md @@ -2,10 +2,15 @@ # jc.parsers.tracepath jc - JSON CLI output utility tracepath Parser -Usage: +Usage (cli): specify --tracepath as the first argument if the piped input is coming from tracepath +Usage (module): + + import jc.parsers.tracepath + result = jc.parsers.tracepath.parse(tracepath_command_output) + Compatibility: 'linux' diff --git a/docs/parsers/traceroute.md b/docs/parsers/traceroute.md index bcc68803..50ce54d4 100644 --- a/docs/parsers/traceroute.md +++ b/docs/parsers/traceroute.md @@ -2,7 +2,7 @@ # jc.parsers.traceroute jc - JSON CLI output utility traceroute Parser -Usage: +Usage (cli): specify --traceroute as the first argument if the piped input is coming from traceroute @@ -12,6 +12,11 @@ Usage: e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute +Usage (module): + + import jc.parsers.traceroute + result = jc.parsers.traceroute.parse(traceroute_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/docs/parsers/uname.md b/docs/parsers/uname.md index b91e5c60..e41815b9 100644 --- a/docs/parsers/uname.md +++ b/docs/parsers/uname.md @@ -2,9 +2,14 @@ # jc.parsers.uname jc - JSON CLI output utility uname Parser -Usage: +Usage (cli): - specify --uname as the first argument if the piped input is coming from uname + specify --uname as the first argument if the piped input is coming from uname -a + +Usage (module): + + import jc.parsers.uname + result = jc.parsers.uname.parse(uname_command_output) Limitations: diff --git a/docs/parsers/uptime.md b/docs/parsers/uptime.md index 31a44f91..07a1d969 100644 --- a/docs/parsers/uptime.md +++ b/docs/parsers/uptime.md @@ -2,10 +2,15 @@ # jc.parsers.uptime jc - JSON CLI output utility uptime Parser -Usage: +Usage (cli): specify --uptime as the first argument if the piped input is coming from uptime +Usage (module): + + import jc.parsers.uptime + result = jc.parsers.uptime.parse(uptime_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/w.md b/docs/parsers/w.md index 1c765bcd..7fa0644a 100644 --- a/docs/parsers/w.md +++ b/docs/parsers/w.md @@ -2,10 +2,15 @@ # jc.parsers.w jc - JSON CLI output utility w Parser -Usage: +Usage (cli): specify --w as the first argument if the piped input is coming from w +Usage (module): + + import jc.parsers.w + result = jc.parsers.w.parse(w_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/who.md b/docs/parsers/who.md index 97011315..30fa9941 100644 --- a/docs/parsers/who.md +++ b/docs/parsers/who.md @@ -2,12 +2,17 @@ # jc.parsers.who jc - JSON CLI output utility who Parser -Usage: +Usage (cli): specify --who as the first argument if the piped input is coming from who accepts any of the following who options (or no options): -aTH +Usage (module): + + import jc.parsers.who + result = jc.parsers.who.parse(who_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/docs/parsers/xml.md b/docs/parsers/xml.md index 9189f932..97d92926 100644 --- a/docs/parsers/xml.md +++ b/docs/parsers/xml.md @@ -2,10 +2,15 @@ # jc.parsers.xml jc - JSON CLI output utility XML Parser -Usage: +Usage (cli): specify --xml as the first argument if the piped input is coming from an XML file +Usage (module): + + import jc.parsers.xml + result = jc.parsers.xml.parse(xml_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/docs/parsers/yaml.md b/docs/parsers/yaml.md index f63843c3..fca532dd 100644 --- a/docs/parsers/yaml.md +++ b/docs/parsers/yaml.md @@ -2,10 +2,15 @@ # jc.parsers.yaml jc - JSON CLI output utility YAML Parser -Usage: +Usage (cli): specify --yaml as the first argument if the piped input is coming from a YAML file +Usage (module): + + import jc.parsers.yaml + result = jc.parsers.yaml.parse(yaml_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/airport.py b/jc/parsers/airport.py index 4d75f52a..a9c9f398 100644 --- a/jc/parsers/airport.py +++ b/jc/parsers/airport.py @@ -1,12 +1,17 @@ """jc - JSON CLI output utility airport -I Parser -Usage: +Usage (cli): specify --airport as the first argument if the piped input is coming from airport -I (OSX) This program can be found at: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport +Usage (module): + + import jc.parsers.airport + result = jc.parsers.airport.parse(airport_command_output) + Compatibility: 'darwin' diff --git a/jc/parsers/airport_s.py b/jc/parsers/airport_s.py index 8a19e592..4ca18f70 100644 --- a/jc/parsers/airport_s.py +++ b/jc/parsers/airport_s.py @@ -1,12 +1,17 @@ """jc - JSON CLI output utility airport -s Parser -Usage: +Usage (cli): specify --airport as the first argument if the piped input is coming from airport -s (OSX) This program can be found at: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport +Usage (module): + + import jc.parsers.airport_s + result = jc.parsers.airport_s.parse(airport_s_command_output) + Compatibility: 'darwin' diff --git a/jc/parsers/arp.py b/jc/parsers/arp.py index b9fddbe8..56b1579b 100644 --- a/jc/parsers/arp.py +++ b/jc/parsers/arp.py @@ -1,6 +1,6 @@ """jc - JSON CLI output utility arp Parser -Usage: +Usage (cli): specify --arp as the first argument if the piped input is coming from: @@ -8,6 +8,11 @@ Usage: or arp -a +Usage (module): + + import jc.parsers.arp + result = jc.parsers.arp.parse(arp_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/jc/parsers/blkid.py b/jc/parsers/blkid.py index f528bd7f..cb0279e8 100644 --- a/jc/parsers/blkid.py +++ b/jc/parsers/blkid.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility blkid Parser -Usage: +Usage (cli): specify --blkid as the first argument if the piped input is coming from blkid +Usage (module): + + import jc.parsers.blkid + result = jc.parsers.blkid.parse(blkid_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/crontab.py b/jc/parsers/crontab.py index a155dded..f10b0656 100644 --- a/jc/parsers/crontab.py +++ b/jc/parsers/crontab.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility crontab command and file Parser -Usage: +Usage (cli): specify --crontab as the first argument if the piped input is coming from crontab -l or a crontab file +Usage (module): + + import jc.parsers.crontab + result = jc.parsers.crontab.parse(crontab_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/crontab_u.py b/jc/parsers/crontab_u.py index 0b3484c2..aacec863 100644 --- a/jc/parsers/crontab_u.py +++ b/jc/parsers/crontab_u.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility crontab file Parser -Usage: +Usage (cli): specify --crontab-u as the first argument if the piped input is coming from a crontab file with User specified +Usage (module): + + import jc.parsers.crontab_u + result = jc.parsers.crontab_u.parse(crontab_u_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/csv.py b/jc/parsers/csv.py index fea8d642..cc645e61 100644 --- a/jc/parsers/csv.py +++ b/jc/parsers/csv.py @@ -1,12 +1,17 @@ """jc - JSON CLI output utility csv Parser -Usage: +Usage (cli): specify --csv as the first argument if the piped input is coming from a csv file. the csv parser will attempt to automatically detect the delimiter character. if the delimiter cannot be detected it will default to comma. the first row of the file must be a header row. +Usage (module): + + import jc.parsers.csv + result = jc.parsers.csv.parse(csv_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/date.py b/jc/parsers/date.py index d0541905..d45c8a34 100644 --- a/jc/parsers/date.py +++ b/jc/parsers/date.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility date Parser -Usage: +Usage (cli): specify --date as the first argument if the piped input is coming from date +Usage (module): + + import jc.parsers.date + result = jc.parsers.date.parse(date_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/df.py b/jc/parsers/df.py index 8d042d5a..d951faf4 100644 --- a/jc/parsers/df.py +++ b/jc/parsers/df.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility df Parser -Usage: +Usage (cli): specify --df as the first argument if the piped input is coming from df +Usage (module): + + import jc.parsers.df + result = jc.parsers.df.parse(df_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/dig.py b/jc/parsers/dig.py index 1181371f..95c5c313 100644 --- a/jc/parsers/dig.py +++ b/jc/parsers/dig.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility dig Parser -Usage: +Usage (cli): Specify --dig as the first argument if the piped input is coming from dig +Usage (module): + + import jc.parsers.dig + result = jc.parsers.dig.parse(dig_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/dmidecode.py b/jc/parsers/dmidecode.py index 06cb6c96..e021f8e7 100644 --- a/jc/parsers/dmidecode.py +++ b/jc/parsers/dmidecode.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility dmidecode Parser -Usage: +Usage (cli): specify --dmidecode as the first argument if the piped input is coming from dmidecode +Usage (module): + + import jc.parsers.dmidecode + result = jc.parsers.dmidecode.parse(dmidecode_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/du.py b/jc/parsers/du.py index 929161d8..5e36e6f4 100644 --- a/jc/parsers/du.py +++ b/jc/parsers/du.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility du Parser -Usage: +Usage (cli): specify --du as the first argument if the piped input is coming from du +Usage (module): + + import jc.parsers.du + result = jc.parsers.du.parse(du_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/env.py b/jc/parsers/env.py index dafed43b..9dfffe20 100644 --- a/jc/parsers/env.py +++ b/jc/parsers/env.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility env Parser -Usage: +Usage (cli): specify --env as the first argument if the piped input is coming from env +Usage (module): + + import jc.parsers.env + result = jc.parsers.env.parse(env_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/file.py b/jc/parsers/file.py index c3634afa..43898591 100644 --- a/jc/parsers/file.py +++ b/jc/parsers/file.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility file command Parser -Usage: +Usage (cli): specify --file as the first argument if the piped input is coming from file. +Usage (module): + + import jc.parsers.file + result = jc.parsers.file.parse(file_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/jc/parsers/foo.py b/jc/parsers/foo.py index 00266713..a4675710 100644 --- a/jc/parsers/foo.py +++ b/jc/parsers/foo.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility foo Parser -Usage: +Usage (cli): specify --foo as the first argument if the piped input is coming from foo +Usage (module): + + import jc.parsers.foo + result = jc.parsers.foo.parse(foo_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/free.py b/jc/parsers/free.py index bbc24da2..c7cdc01c 100644 --- a/jc/parsers/free.py +++ b/jc/parsers/free.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility free Parser -Usage: +Usage (cli): specify --free as the first argument if the piped input is coming from free +Usage (module): + + import jc.parsers.free + result = jc.parsers.free.parse(free_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/fstab.py b/jc/parsers/fstab.py index 1d8e7cda..f97d4c71 100644 --- a/jc/parsers/fstab.py +++ b/jc/parsers/fstab.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility fstab Parser -Usage: +Usage (cli): specify --fstab as the first argument if the piped input is coming from a fstab file +Usage (module): + + import jc.parsers.fstab + result = jc.parsers.fstab.parse(fstab_command_output) + Compatibility: 'linux', 'freebsd' diff --git a/jc/parsers/group.py b/jc/parsers/group.py index b4ef57dd..577088fd 100644 --- a/jc/parsers/group.py +++ b/jc/parsers/group.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility /etc/group file Parser -Usage: +Usage (cli): specify --group as the first argument if the piped input is coming from /etc/group +Usage (module): + + import jc.parsers.group + result = jc.parsers.group.parse(group_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/gshadow.py b/jc/parsers/gshadow.py index e6abb20b..c6a073db 100644 --- a/jc/parsers/gshadow.py +++ b/jc/parsers/gshadow.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility /etc/gshadow file Parser -Usage: +Usage (cli): specify --gshadow as the first argument if the piped input is coming from /etc/gshadow +Usage (module): + + import jc.parsers.gshadow + result = jc.parsers.gshadow.parse(gshadow_file_output) + Compatibility: 'linux', 'aix', 'freebsd' diff --git a/jc/parsers/history.py b/jc/parsers/history.py index 881af9c4..0666d459 100644 --- a/jc/parsers/history.py +++ b/jc/parsers/history.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility history Parser -Usage: +Usage (cli): specify --history as the first argument if the piped input is coming from history +Usage (module): + + import jc.parsers.history + result = jc.parsers.history.parse(history_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/hosts.py b/jc/parsers/hosts.py index d044f59b..4a617b02 100644 --- a/jc/parsers/hosts.py +++ b/jc/parsers/hosts.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility hosts Parser -Usage: +Usage (cli): specify --hosts as the first argument if the piped input is coming from a hosts file +Usage (module): + + import jc.parsers.hosts + result = jc.parsers.hosts.parse(hosts_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/id.py b/jc/parsers/id.py index b7ce0810..34ab86bd 100644 --- a/jc/parsers/id.py +++ b/jc/parsers/id.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility id Parser -Usage: +Usage (cli): specify --id as the first argument if the piped input is coming from id +Usage (module): + + import jc.parsers.id + result = jc.parsers.id.parse(id_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/ifconfig.py b/jc/parsers/ifconfig.py index e91cf3c4..1418f022 100644 --- a/jc/parsers/ifconfig.py +++ b/jc/parsers/ifconfig.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility ifconfig Parser -Usage: +Usage (cli): specify --ifconfig as the first argument if the piped input is coming from ifconfig no ifconfig options are supported. +Usage (module): + + import jc.parsers.ifconfig + result = jc.parsers.ifconfig.parse(ifconfig_command_output) + Compatibility: 'linux', 'aix', 'freebsd', 'darwin' diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index 86ae76d4..cce3774a 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility INI Parser -Usage: +Usage (cli): Specify --ini as the first argument if the piped input is coming from an INI file or any simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. Comment prefix can be '#' or ';'. Comments must be on their own line. +Usage (module): + + import jc.parsers.ini + result = jc.parsers.ini.parse(ini_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/iptables.py b/jc/parsers/iptables.py index 2d3c7d8c..073c2cbb 100644 --- a/jc/parsers/iptables.py +++ b/jc/parsers/iptables.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility ipables Parser -Usage: +Usage (cli): Specify --iptables as the first argument if the piped input is coming from iptables Supports -vLn and --line-numbers for all tables +Usage (module): + + import jc.parsers.iptables + result = jc.parsers.iptables.parse(iptables_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/jobs.py b/jc/parsers/jobs.py index 73e4e9e4..e94c34a2 100644 --- a/jc/parsers/jobs.py +++ b/jc/parsers/jobs.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility jobs Parser -Usage: +Usage (cli): specify --jobs as the first argument if the piped input is coming from jobs Also supports the -l option +Usage (module): + + import jc.parsers.jobs + result = jc.parsers.jobs.parse(jobs_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/kv.py b/jc/parsers/kv.py index 88a21e15..87828e74 100644 --- a/jc/parsers/kv.py +++ b/jc/parsers/kv.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility Key/Value File Parser -Usage: +Usage (cli): Specify --kv as the first argument if the piped input is coming from a simple key/value pair file. Delimiter can be '=' or ':'. Missing values are supported. Comment prefix can be '#' or ';'. Comments must be on their own line. +Usage (module): + + import jc.parsers.kv + result = jc.parsers.kv.parse(kv_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/last.py b/jc/parsers/last.py index 71defd84..89703239 100644 --- a/jc/parsers/last.py +++ b/jc/parsers/last.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility last Parser -Usage: +Usage (cli): specify --last as the first argument if the piped input is coming from last or lastb +Usage (module): + + import jc.parsers.last + result = jc.parsers.last.parse(last_command_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index 68e591a3..35a7d0fa 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -4,7 +4,7 @@ Note: The -l or -b option of ls should be used to correctly parse filenames that Since ls does not encode newlines in filenames when outputting to a pipe it will cause jc to see multiple files instead of a single file if -l or -b is not used. -Usage: +Usage (cli): specify --ls as the first argument if the piped input is coming from ls @@ -16,6 +16,11 @@ Usage: with human readable suffixes will be converted to Null in default view since the parser attempts to convert this field to an integer. +Usage (module): + + import jc.parsers.ls + result = jc.parsers.ls.parse(ls_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/lsblk.py b/jc/parsers/lsblk.py index 4273fc86..cb197657 100644 --- a/jc/parsers/lsblk.py +++ b/jc/parsers/lsblk.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility lsblk Parser -Usage: +Usage (cli): specify --lsblk as the first argument if the piped input is coming from lsblk +Usage (module): + + import jc.parsers.lsblk + result = jc.parsers.lsblk.parse(lsblk_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/lsmod.py b/jc/parsers/lsmod.py index b264f65b..e2c756ab 100644 --- a/jc/parsers/lsmod.py +++ b/jc/parsers/lsmod.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility lsmod Parser -Usage: +Usage (cli): specify --lsmod as the first argument if the piped input is coming from lsmod +Usage (module): + + import jc.parsers.lsmod + result = jc.parsers.lsmod.parse(lsmod_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/lsof.py b/jc/parsers/lsof.py index f1bff487..df334fe3 100644 --- a/jc/parsers/lsof.py +++ b/jc/parsers/lsof.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility lsof Parser -Usage: +Usage (cli): specify --lsof as the first argument if the piped input is coming from lsof +Usage (module): + + import jc.parsers.lsof + result = jc.parsers.lsof.parse(lsof_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/mount.py b/jc/parsers/mount.py index d636b5cd..67c9bf80 100644 --- a/jc/parsers/mount.py +++ b/jc/parsers/mount.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility mount Parser -Usage: +Usage (cli): specify --mount as the first argument if the piped input is coming from mount +Usage (module): + + import jc.parsers.mount + result = jc.parsers.mount.parse(mount_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/netstat.py b/jc/parsers/netstat.py index 80bf7b87..927ecab3 100644 --- a/jc/parsers/netstat.py +++ b/jc/parsers/netstat.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility netstat Parser -Usage: +Usage (cli): Specify --netstat as the first argument if the piped input is coming from netstat +Usage (module): + + import jc.parsers.netstat + result = jc.parsers.netstat.parse(netstat_command_output) + Caveats: - Use of multiple 'l' options is not supported on OSX (e.g. 'netstat -rlll') diff --git a/jc/parsers/ntpq.py b/jc/parsers/ntpq.py index 193f19d3..521f83cd 100644 --- a/jc/parsers/ntpq.py +++ b/jc/parsers/ntpq.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility ntpq Parser -Usage: +Usage (cli): specify --ntpq as the first argument if the piped input is coming from ntpq -p +Usage (module): + + import jc.parsers.ntpq + result = jc.parsers.ntpq.parse(ntpq_command_output) + Compatibility: 'linux', 'freebsd' diff --git a/jc/parsers/passwd.py b/jc/parsers/passwd.py index 90a8aabf..5df9678a 100644 --- a/jc/parsers/passwd.py +++ b/jc/parsers/passwd.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility /etc/passwd file Parser -Usage: +Usage (cli): specify --passwd as the first argument if the piped input is coming from /etc/passwd +Usage (module): + + import jc.parsers.passwd + result = jc.parsers.passwd.parse(passwd_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 937109a8..574059e2 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility ping Parser -Usage: +Usage (cli): specify --ping as the first argument if the piped input is coming from ping Note: Use the ping -c (count) option, otherwise data will not be piped to jc. +Usage (module): + + import jc.parsers.ping + result = jc.parsers.ping.parse(ping_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/pip_list.py b/jc/parsers/pip_list.py index 70345930..c5972a0b 100644 --- a/jc/parsers/pip_list.py +++ b/jc/parsers/pip_list.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility pip-list Parser -Usage: +Usage (cli): specify --pip-list as the first argument if the piped input is coming from pip list +Usage (module): + + import jc.parsers.pip_list + result = jc.parsers.pip_list.parse(pip_list_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/pip_show.py b/jc/parsers/pip_show.py index a594e806..ec6d51dc 100644 --- a/jc/parsers/pip_show.py +++ b/jc/parsers/pip_show.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility pip-show Parser -Usage: +Usage (cli): specify --pip-show as the first argument if the piped input is coming from pip show +Usage (module): + + import jc.parsers.pip_show + result = jc.parsers.pip_show.parse(pip_show_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/ps.py b/jc/parsers/ps.py index 8179cc29..d8c2035c 100644 --- a/jc/parsers/ps.py +++ b/jc/parsers/ps.py @@ -1,6 +1,6 @@ """jc - JSON CLI output utility ps Parser -Usage: +Usage (cli): specify --ps as the first argument if the piped input is coming from ps @@ -8,6 +8,11 @@ Usage: - ef - axu +Usage (module): + + import jc.parsers.ps + result = jc.parsers.ps.parse(ps_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/route.py b/jc/parsers/route.py index b14558b5..b8e4cde3 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility route Parser -Usage: +Usage (cli): specify --route as the first argument if the piped input is coming from route +Usage (module): + + import jc.parsers.route + result = jc.parsers.route.parse(route_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/shadow.py b/jc/parsers/shadow.py index 4a2170e5..9f9d435a 100644 --- a/jc/parsers/shadow.py +++ b/jc/parsers/shadow.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility /etc/shadow file Parser -Usage: +Usage (cli): specify --shadow as the first argument if the piped input is coming from /etc/shadow +Usage (module): + + import jc.parsers.shadow + result = jc.parsers.shadow.parse(shadow_file_output) + Compatibility: 'linux', 'darwin', 'aix', 'freebsd' diff --git a/jc/parsers/ss.py b/jc/parsers/ss.py index e9a03117..3b37bd20 100644 --- a/jc/parsers/ss.py +++ b/jc/parsers/ss.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility ss Parser -Usage: +Usage (cli): specify --ss as the first argument if the piped input is coming from ss +Usage (module): + + import jc.parsers.ss + result = jc.parsers.ss.parse(ss_command_output) + Limitations: Extended information options like -e and -p are not supported and may cause parsing irregularities diff --git a/jc/parsers/stat.py b/jc/parsers/stat.py index 5ea591e6..a6f29f60 100644 --- a/jc/parsers/stat.py +++ b/jc/parsers/stat.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility stat Parser -Usage: +Usage (cli): specify --stat as the first argument if the piped input is coming from stat +Usage (module): + + import jc.parsers.stat + result = jc.parsers.stat.parse(stat_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/sysctl.py b/jc/parsers/sysctl.py index 2b25a9f9..81b63b46 100644 --- a/jc/parsers/sysctl.py +++ b/jc/parsers/sysctl.py @@ -1,6 +1,6 @@ """jc - JSON CLI output utility sysctl -a Parser -Usage: +Usage (cli): specify --sysctl as the first argument if the piped input is coming from sysctl -a @@ -8,6 +8,11 @@ Usage: will be output. An attempt is made to convert obvious integers and floats. If no conversion is desired, use the -r (raw) option. +Usage (module): + + import jc.parsers.sysctl + result = jc.parsers.sysctl.parse(sysctl_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/systemctl.py b/jc/parsers/systemctl.py index 16edf109..ab0535db 100644 --- a/jc/parsers/systemctl.py +++ b/jc/parsers/systemctl.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility systemctl Parser -Usage: +Usage (cli): specify --systemctl as the first argument if the piped input is coming from systemctl +Usage (module): + + import jc.parsers.systemctl + result = jc.parsers.systemctl.parse(systemctl_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/systemctl_lj.py b/jc/parsers/systemctl_lj.py index 5441eabf..898623c9 100644 --- a/jc/parsers/systemctl_lj.py +++ b/jc/parsers/systemctl_lj.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility systemctl-lj Parser -Usage: +Usage (cli): specify --systemctl-lj as the first argument if the piped input is coming from systemctl list-jobs +Usage (module): + + import jc.parsers.systemctl_lj + result = jc.parsers.systemctl_lj.parse(systemctl_lj_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/systemctl_ls.py b/jc/parsers/systemctl_ls.py index 7160cdb4..c36f02b9 100644 --- a/jc/parsers/systemctl_ls.py +++ b/jc/parsers/systemctl_ls.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility systemctl-ls Parser -Usage: +Usage (cli): specify --systemctl-ls as the first argument if the piped input is coming from systemctl list-sockets +Usage (module): + + import jc.parsers.systemctl_ls + result = jc.parsers.systemctl_ls.parse(systemctl_ls_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/systemctl_luf.py b/jc/parsers/systemctl_luf.py index 402f57cf..84569848 100644 --- a/jc/parsers/systemctl_luf.py +++ b/jc/parsers/systemctl_luf.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility systemctl-luf Parser -Usage: +Usage (cli): specify --systemctl-luf as the first argument if the piped input is coming from systemctl list-unit-files +Usage (module): + + import jc.parsers.systemctl_luf + result = jc.parsers.systemctl_luf.parse(systemctl_luf_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/timedatectl.py b/jc/parsers/timedatectl.py index 4955855b..8b277824 100644 --- a/jc/parsers/timedatectl.py +++ b/jc/parsers/timedatectl.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility timedatectl Parser -Usage: +Usage (cli): specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status +Usage (module): + + import jc.parsers.timedatectl + result = jc.parsers.timedatectl.parse(timedatectl_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py index f3ac5072..6630aa97 100644 --- a/jc/parsers/tracepath.py +++ b/jc/parsers/tracepath.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility tracepath Parser -Usage: +Usage (cli): specify --tracepath as the first argument if the piped input is coming from tracepath +Usage (module): + + import jc.parsers.tracepath + result = jc.parsers.tracepath.parse(tracepath_command_output) + Compatibility: 'linux' diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index 00f695da..c7ea9437 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -1,6 +1,6 @@ """jc - JSON CLI output utility traceroute Parser -Usage: +Usage (cli): specify --traceroute as the first argument if the piped input is coming from traceroute @@ -10,6 +10,11 @@ Usage: e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute +Usage (module): + + import jc.parsers.traceroute + result = jc.parsers.traceroute.parse(traceroute_command_output) + Compatibility: 'linux', 'darwin', 'freebsd' diff --git a/jc/parsers/uname.py b/jc/parsers/uname.py index 96014671..c9787100 100644 --- a/jc/parsers/uname.py +++ b/jc/parsers/uname.py @@ -1,8 +1,13 @@ """jc - JSON CLI output utility uname Parser -Usage: +Usage (cli): - specify --uname as the first argument if the piped input is coming from uname + specify --uname as the first argument if the piped input is coming from uname -a + +Usage (module): + + import jc.parsers.uname + result = jc.parsers.uname.parse(uname_command_output) Limitations: diff --git a/jc/parsers/uptime.py b/jc/parsers/uptime.py index 1cdca803..cbb71b19 100644 --- a/jc/parsers/uptime.py +++ b/jc/parsers/uptime.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility uptime Parser -Usage: +Usage (cli): specify --uptime as the first argument if the piped input is coming from uptime +Usage (module): + + import jc.parsers.uptime + result = jc.parsers.uptime.parse(uptime_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/w.py b/jc/parsers/w.py index aa681888..9a4e0fa1 100644 --- a/jc/parsers/w.py +++ b/jc/parsers/w.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility w Parser -Usage: +Usage (cli): specify --w as the first argument if the piped input is coming from w +Usage (module): + + import jc.parsers.w + result = jc.parsers.w.parse(w_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/who.py b/jc/parsers/who.py index 881b66ec..56eecc5f 100644 --- a/jc/parsers/who.py +++ b/jc/parsers/who.py @@ -1,11 +1,16 @@ """jc - JSON CLI output utility who Parser -Usage: +Usage (cli): specify --who as the first argument if the piped input is coming from who accepts any of the following who options (or no options): -aTH +Usage (module): + + import jc.parsers.who + result = jc.parsers.who.parse(who_command_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'aix', 'freebsd' diff --git a/jc/parsers/xml.py b/jc/parsers/xml.py index 8be22544..532fcb46 100644 --- a/jc/parsers/xml.py +++ b/jc/parsers/xml.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility XML Parser -Usage: +Usage (cli): specify --xml as the first argument if the piped input is coming from an XML file +Usage (module): + + import jc.parsers.xml + result = jc.parsers.xml.parse(xml_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd' diff --git a/jc/parsers/yaml.py b/jc/parsers/yaml.py index a049db2a..e3271985 100644 --- a/jc/parsers/yaml.py +++ b/jc/parsers/yaml.py @@ -1,9 +1,14 @@ """jc - JSON CLI output utility YAML Parser -Usage: +Usage (cli): specify --yaml as the first argument if the piped input is coming from a YAML file +Usage (module): + + import jc.parsers.yaml + result = jc.parsers.yaml.parse(yaml_file_output) + Compatibility: 'linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'