1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-07-15 01:24:29 +02:00

enhance docs

This commit is contained in:
Kelly Brazil
2020-08-05 16:51:58 -07:00
parent 6ed48c6289
commit 59b1055808
97 changed files with 564 additions and 269 deletions

View File

@ -1,6 +1,6 @@
# jc.parsers.airport_s
jc - JSON CLI output utility `airport -s` command parser
jc - JSON CLI output utility `airport -s` command output parser
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.

View File

@ -1,14 +1,16 @@
# jc.parsers.arp
jc - JSON CLI output utility arp Parser
jc - JSON CLI output utility `arp` command output parser
Supports `arp` and `arp -a` output.
Usage (cli):
specify --arp as the first argument if the piped input is coming from:
$ arp | jc --arp
arp
or
arp -a
or
$ jc arp
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.blkid
jc - JSON CLI output utility blkid Parser
jc - JSON CLI output utility `blkid` command output parser
Usage (cli):
specify --blkid as the first argument if the piped input is coming from blkid
$ blkid | jc --blkid
or
$ jc blkid
Usage (module):

View File

@ -1,10 +1,16 @@
# jc.parsers.crontab
jc - JSON CLI output utility crontab command and file Parser
jc - JSON CLI output utility `crontab -l` command output and crontab file parser
Supports `crontab -l` command output and crontab files.
Usage (cli):
specify --crontab as the first argument if the piped input is coming from crontab -l or a crontab file
$ crontab -l | jc --crontab
or
$ jc crontab -l
Usage (module):

View File

@ -1,10 +1,12 @@
# jc.parsers.crontab_u
jc - JSON CLI output utility crontab file Parser
jc - JSON CLI output utility `crontab -l` command output and crontab file parser
This version of the `crontab -l` parser supports output that contains user information for processes.
Usage (cli):
specify --crontab-u as the first argument if the piped input is coming from a crontab file with User specified
$ crontab -l | jc --crontab-u
Usage (module):

View File

@ -1,13 +1,12 @@
# jc.parsers.csv
jc - JSON CLI output utility csv Parser
jc - JSON CLI output utility `csv` file parser
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 (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.
$ cat file.csv | jc --csv
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.date
jc - JSON CLI output utility date Parser
jc - JSON CLI output utility `date` command output parser
Usage (cli):
specify --date as the first argument if the piped input is coming from date
$ date | jc --date
or
$ jc date
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.df
jc - JSON CLI output utility df Parser
jc - JSON CLI output utility `df` command output parser
Usage (cli):
specify --df as the first argument if the piped input is coming from df
$ df | jc --df
or
$ jc df
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.dig
jc - JSON CLI output utility dig Parser
jc - JSON CLI output utility `dig` command output parser
Usage (cli):
Specify --dig as the first argument if the piped input is coming from dig
$ dig example.com | jc --dig
or
$ jc dig example.com
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.dmidecode
jc - JSON CLI output utility dmidecode Parser
jc - JSON CLI output utility `dmidecode` command output parser
Usage (cli):
specify --dmidecode as the first argument if the piped input is coming from dmidecode
$ dmidecode | jc --dmidecode
or
$ jc dmidecode
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.du
jc - JSON CLI output utility du Parser
jc - JSON CLI output utility `du` command output parser
Usage (cli):
specify --du as the first argument if the piped input is coming from du
$ du | jc --du
or
$ jc du
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.env
jc - JSON CLI output utility env Parser
jc - JSON CLI output utility `env` command output parser
Usage (cli):
specify --env as the first argument if the piped input is coming from env
$ env | jc --env
or
$ jc env
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.file
jc - JSON CLI output utility file command Parser
jc - JSON CLI output utility `file` command output parser
Usage (cli):
specify --file as the first argument if the piped input is coming from file.
$ file * | jc --file
or
$ jc file *
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.free
jc - JSON CLI output utility free Parser
jc - JSON CLI output utility `free` command output parser
Usage (cli):
specify --free as the first argument if the piped input is coming from free
$ free | jc --free
or
$ jc free
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.fstab
jc - JSON CLI output utility fstab Parser
jc - JSON CLI output utility `fstab` file parser
Usage (cli):
specify --fstab as the first argument if the piped input is coming from a fstab file
$ cat /etc/fstab | jc --fstab
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.group
jc - JSON CLI output utility /etc/group file Parser
jc - JSON CLI output utility `/etc/group` file parser
Usage (cli):
specify --group as the first argument if the piped input is coming from /etc/group
$ cat /etc/group | jc --group
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.gshadow
jc - JSON CLI output utility /etc/gshadow file Parser
jc - JSON CLI output utility `/etc/gshadow` file parser
Usage (cli):
specify --gshadow as the first argument if the piped input is coming from /etc/gshadow
$ cat /etc/gshadow | jc --gshadow
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.history
jc - JSON CLI output utility history Parser
jc - JSON CLI output utility `history` command output parser
Usage (cli):
specify --history as the first argument if the piped input is coming from history
$ history | jc --history
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.hosts
jc - JSON CLI output utility hosts Parser
jc - JSON CLI output utility `/etc/hosts` file parser
Usage (cli):
specify --hosts as the first argument if the piped input is coming from a hosts file
$ cat /etc/hosts | jc --hosts
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.id
jc - JSON CLI output utility id Parser
jc - JSON CLI output utility `id` command output parser
Usage (cli):
specify --id as the first argument if the piped input is coming from id
$ id | jc --id
or
$ jc id
Usage (module):

View File

@ -1,12 +1,16 @@
# jc.parsers.ifconfig
jc - JSON CLI output utility ifconfig Parser
jc - JSON CLI output utility `ifconfig` command output parser
Note: No `ifconfig` options are supported.
Usage (cli):
specify --ifconfig as the first argument if the piped input is coming from ifconfig
$ ifconfig | jc --ifconfig
no ifconfig options are supported.
or
$ jc ifconfig
Usage (module):

View File

@ -1,12 +1,14 @@
# jc.parsers.ini
jc - JSON CLI output utility INI Parser
jc - JSON CLI output utility `INI` file parser
Parses standard `INI` files and files containing simple key/value pairs. Delimiter can be `=` or `:`. Missing values are supported. Comment prefix can be `#` or `;`. Comments must be on their own line.
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):
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.
$ cat foo.ini | jc --ini
Usage (module):

View File

@ -1,12 +1,16 @@
# jc.parsers.iptables
jc - JSON CLI output utility ipables Parser
jc - JSON CLI output utility `ipables` command output parser
Supports `-vLn` and `--line-numbers` for all tables.
Usage (cli):
Specify --iptables as the first argument if the piped input is coming from iptables
$ sudo iptables -L -t nat | jc --iptables
Supports -vLn and --line-numbers for all tables
or
$ jc iptables -L -t nat
Usage (module):

View File

@ -1,12 +1,16 @@
# jc.parsers.jobs
jc - JSON CLI output utility jobs Parser
jc - JSON CLI output utility `jobs` command output parser
Also supports the `-l` option.
Usage (cli):
specify --jobs as the first argument if the piped input is coming from jobs
$ jobs | jc --jobs
Also supports the -l option
or
$ jc jobs
Usage (module):

View File

@ -1,12 +1,15 @@
# jc.parsers.kv
jc - JSON CLI output utility Key/Value File Parser
jc - JSON CLI output utility `Key/Value` file parser
Supports files containing simple key/value pairs. Delimiter can be `=` or `:`. Missing values are supported. Comment prefix can be `#` or `;`. Comments must be on their own line.
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):
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.
$ cat foo.txt | jc --kv
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.last
jc - JSON CLI output utility last Parser
jc - JSON CLI output utility `last` and `lastb` command output parser
Usage (cli):
specify --last as the first argument if the piped input is coming from last or lastb
$ last | jc --last
or
$ jc last
Usage (module):

View File

@ -1,22 +1,21 @@
# jc.parsers.ls
jc - JSON CLI output utility ls Parser
jc - JSON CLI output utility `ls` command output parser
Note: The -l or -b option of ls should be used to correctly parse filenames that include newline characters.
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.
Options supported:
- `lbaR`
- `--time-style=full-iso`
- `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. 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 (cli):
specify --ls as the first argument if the piped input is coming from ls
$ ls | jc --ls
ls options supported:
or
-lbaR
--time-style=full-iso
-h file sizes will be available in text form with -r but larger file sizes
with human readable suffixes will be converted to Null in default view
since the parser attempts to convert this field to an integer.
$ jc ls
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.lsblk
jc - JSON CLI output utility lsblk Parser
jc - JSON CLI output utility `lsblk` command output parser
Usage (cli):
specify --lsblk as the first argument if the piped input is coming from lsblk
$ lsblk | jc --lsblk
or
$ jc lsblk
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.lsmod
jc - JSON CLI output utility lsmod Parser
jc - JSON CLI output utility `lsmod` command output parser
Usage (cli):
specify --lsmod as the first argument if the piped input is coming from lsmod
$ lsmod | jc --lsmod
or
$ jc lsmod
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.lsof
jc - JSON CLI output utility lsof Parser
jc - JSON CLI output utility `lsof` command output parser
Usage (cli):
specify --lsof as the first argument if the piped input is coming from lsof
$ lsof | jc --lsof
or
$ jc lsof
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.mount
jc - JSON CLI output utility mount Parser
jc - JSON CLI output utility `mount` command output parser
Usage (cli):
specify --mount as the first argument if the piped input is coming from mount
$ mount | jc --mount
or
$ jc mount
Usage (module):

View File

@ -1,21 +1,24 @@
# jc.parsers.netstat
jc - JSON CLI output utility netstat Parser
jc - JSON CLI output utility `netstat` command output parser
Caveats:
- Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`)
- Use of the `A` option is not supported on OSX when using the `r` option (e.g. `netstat -rA`)
Usage (cli):
Specify --netstat as the first argument if the piped input is coming from netstat
$ netstat | jc --netstat
or
$ jc 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')
- Use of the 'A' option is not supported on OSX when using the 'r' option (e.g. netstat -rA)
Compatibility:
'linux', 'darwin', 'freebsd'

View File

@ -1,10 +1,14 @@
# jc.parsers.ntpq
jc - JSON CLI output utility ntpq Parser
jc - JSON CLI output utility `ntpq -p` command output parser
Usage (cli):
specify --ntpq as the first argument if the piped input is coming from ntpq -p
$ ntpq -p | jc --ntpq
or
$ jc ntpq -p
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.passwd
jc - JSON CLI output utility /etc/passwd file Parser
jc - JSON CLI output utility `/etc/passwd` file Parser
Usage (cli):
specify --passwd as the first argument if the piped input is coming from /etc/passwd
$ cat /etc/passwd | jc --passwd
Usage (module):

View File

@ -1,12 +1,18 @@
# jc.parsers.ping
jc - JSON CLI output utility ping Parser
jc - JSON CLI output utility `ping` command output parser
Supports `ping` and `ping6` output.
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`.
Note: Use the ping -c (count) option, otherwise data will not be piped to jc.
$ ping -c 3 1.2.3.4 | jc --ping
or
$ jc ping -c 3 1.2.3.4
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.pip_list
jc - JSON CLI output utility pip-list Parser
jc - JSON CLI output utility `pip-list` command output parser
Usage (cli):
specify --pip-list as the first argument if the piped input is coming from pip list
$ pip list | jc --pip-list
or
$ jc pip list
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.pip_show
jc - JSON CLI output utility pip-show Parser
jc - JSON CLI output utility `pip-show` command output parser
Usage (cli):
specify --pip-show as the first argument if the piped input is coming from pip show
$ pip show | jc --pip-show
or
$ jc pip show
Usage (module):

View File

@ -1,14 +1,18 @@
# jc.parsers.ps
jc - JSON CLI output utility ps Parser
jc - JSON CLI output utility `ps` command output parser
`ps` options supported:
- `ef`
- `axu`
Usage (cli):
specify --ps as the first argument if the piped input is coming from ps
$ ps | jc --ps
ps options supported:
- ef
- axu
or
$ jc ps
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.route
jc - JSON CLI output utility route Parser
jc - JSON CLI output utility `route` command output parser
Usage (cli):
specify --route as the first argument if the piped input is coming from route
$ route | jc --route
or
$ jc route
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.shadow
jc - JSON CLI output utility /etc/shadow file Parser
jc - JSON CLI output utility `/etc/shadow` file parser
Usage (cli):
specify --shadow as the first argument if the piped input is coming from /etc/shadow
$ sudo cat /etc/shadow | jc --shadow
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.ss
jc - JSON CLI output utility ss Parser
jc - JSON CLI output utility `ss` command output parser
Usage (cli):
specify --ss as the first argument if the piped input is coming from ss
$ ss | jc --ss
or
$ jc ss
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.stat
jc - JSON CLI output utility stat Parser
jc - JSON CLI output utility `stat` command output parser
Usage (cli):
specify --stat as the first argument if the piped input is coming from stat
$ stat * | jc --stat
or
$ jc stat *
Usage (module):

View File

@ -1,14 +1,16 @@
# jc.parsers.sysctl
jc - JSON CLI output utility sysctl -a Parser
jc - JSON CLI output utility `sysctl -a` command output parser
Note: Since `sysctl` output is not easily parsable only a very simple key/value object will be output. An attempt is made to convert obvious integers and floats. If no conversion is desired, use the `-r` command-line argument or the `raw=True` argument in `parse()`.
Usage (cli):
specify --sysctl as the first argument if the piped input is coming from sysctl -a
$ sysctl -a | jc --sysctl
Note: since sysctl output is not easily parsable only a very simple key/value object
will be output. An attempt is made to convert obvious integers and floats. If no
conversion is desired, use the -r (raw) option.
or
$ jc sysctl -a
Usage (module):
@ -21,7 +23,7 @@ Compatibility:
Examples:
$ sysctl | jc --sysctl -p
$ sysctl -a | jc --sysctl -p
{
"user.cs_path": "/usr/bin:/bin:/usr/sbin:/sbin",
"user.bc_base_max": 99,
@ -33,7 +35,7 @@ Examples:
...
}
$ sysctl | jc --sysctl -p -r
$ sysctl -a | jc --sysctl -p -r
{
"user.cs_path": "/usr/bin:/bin:/usr/sbin:/sbin",
"user.bc_base_max": "99",

View File

@ -1,10 +1,14 @@
# jc.parsers.systemctl
jc - JSON CLI output utility systemctl Parser
jc - JSON CLI output utility `systemctl` command output parser
Usage (cli):
specify --systemctl as the first argument if the piped input is coming from systemctl
$ systemctl | jc --systemctl
or
$ jc systemctl
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.systemctl_lj
jc - JSON CLI output utility systemctl-lj Parser
jc - JSON CLI output utility `systemctl list-jobs` command output parser
Usage (cli):
specify --systemctl-lj as the first argument if the piped input is coming from systemctl list-jobs
$ systemctl list-jobs | jc --systemctl-lj
or
$ jc systemctl list-jobs
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.systemctl_ls
jc - JSON CLI output utility systemctl-ls Parser
jc - JSON CLI output utility `systemctl list-sockets` command output parser
Usage (cli):
specify --systemctl-ls as the first argument if the piped input is coming from systemctl list-sockets
$ systemctl list-sockets | jc --systemctl-ls
or
$ jc systemctl list-sockets
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.systemctl_luf
jc - JSON CLI output utility systemctl-luf Parser
jc - JSON CLI output utility `systemctl list-unit-files` command output parser
Usage (cli):
specify --systemctl-luf as the first argument if the piped input is coming from systemctl list-unit-files
$ systemctl list-unit-files | jc --systemctl-luf
or
$ jc systemctl list-unit-files
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.timedatectl
jc - JSON CLI output utility timedatectl Parser
jc - JSON CLI output utility `timedatectl` command output parser
Usage (cli):
specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status
$ timedatectl | jc --timedatectl
or
$ jc timedatectl
Usage (module):

View File

@ -1,10 +1,16 @@
# jc.parsers.tracepath
jc - JSON CLI output utility tracepath Parser
jc - JSON CLI output utility `tracepath` command output parser
Supports `tracepath` and `tracepath6` output.
Usage (cli):
specify --tracepath as the first argument if the piped input is coming from tracepath
$ tracepath 1.2.3.4 | jc --tracepath
or
$ jc tracepath 1.2.3.4
Usage (module):

View File

@ -1,16 +1,20 @@
# jc.parsers.traceroute
jc - JSON CLI output utility traceroute Parser
jc - JSON CLI output utility `traceroute` command output parser
Supports `traceroute` and `traceroute6` output.
Note: On some operating systems you will need to redirect `STDERR` to `STDOUT` for destination info since the header line is sent to `STDERR`. A warning message will be printed to `STDERR` if the header row is not found.
e.g. `$ traceroute 8.8.8.8 2>&1 | jc --traceroute`
Usage (cli):
specify --traceroute as the first argument if the piped input is coming from traceroute
$ traceroute 1.2.3.4 | jc --traceroute
Note: On some operating systems you will need to redirect STDERR to STDOUT for destination
info since the header line is sent to STDERR. A warning message will be printed to
STDERR if the header row is not found.
or
e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute
$ jc traceroute 1.2.3.4
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.uname
jc - JSON CLI output utility uname Parser
jc - JSON CLI output utility `uname -a` command output parser
Usage (cli):
specify --uname as the first argument if the piped input is coming from uname -a
$ uname -a | jc --uname
or
$ jc uname -a
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.uptime
jc - JSON CLI output utility uptime Parser
jc - JSON CLI output utility `uptime` command output parser
Usage (cli):
specify --uptime as the first argument if the piped input is coming from uptime
$ uptime | jc --uptime
or
$ jc uptime
Usage (module):

View File

@ -1,10 +1,14 @@
# jc.parsers.w
jc - JSON CLI output utility w Parser
jc - JSON CLI output utility `w` command output parser
Usage (cli):
specify --w as the first argument if the piped input is coming from w
$ w | jc --w
or
$ jc w
Usage (module):

View File

@ -1,12 +1,16 @@
# jc.parsers.who
jc - JSON CLI output utility who Parser
jc - JSON CLI output utility `who` command output parser
Accepts any of the following who options (or no options): `-aTH`
Usage (cli):
specify --who as the first argument if the piped input is coming from who
$ who | jc --who
accepts any of the following who options (or no options): -aTH
or
$ jc who
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.xml
jc - JSON CLI output utility XML Parser
jc - JSON CLI output utility `XML` file parser
Usage (cli):
specify --xml as the first argument if the piped input is coming from an XML file
$ cat foo.xml| jc --xml
Usage (module):

View File

@ -1,10 +1,10 @@
# jc.parsers.yaml
jc - JSON CLI output utility YAML Parser
jc - JSON CLI output utility `YAML` file parser
Usage (cli):
specify --yaml as the first argument if the piped input is coming from a YAML file
$ cat foo.yaml| jc --yaml
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility /etc/group file Parser
"""jc - JSON CLI output utility `/etc/group` file parser
Usage (cli):
specify --group as the first argument if the piped input is coming from /etc/group
$ cat /etc/group | jc --group
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility /etc/gshadow file Parser
"""jc - JSON CLI output utility `/etc/gshadow` file parser
Usage (cli):
specify --gshadow as the first argument if the piped input is coming from /etc/gshadow
$ cat /etc/gshadow | jc --gshadow
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility history Parser
"""jc - JSON CLI output utility `history` command output parser
Usage (cli):
specify --history as the first argument if the piped input is coming from history
$ history | jc --history
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility hosts Parser
"""jc - JSON CLI output utility `/etc/hosts` file parser
Usage (cli):
specify --hosts as the first argument if the piped input is coming from a hosts file
$ cat /etc/hosts | jc --hosts
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility id Parser
"""jc - JSON CLI output utility `id` command output parser
Usage (cli):
specify --id as the first argument if the piped input is coming from id
$ id | jc --id
or
$ jc id
Usage (module):

View File

@ -1,10 +1,14 @@
"""jc - JSON CLI output utility ifconfig Parser
"""jc - JSON CLI output utility `ifconfig` command output parser
Note: No `ifconfig` options are supported.
Usage (cli):
specify --ifconfig as the first argument if the piped input is coming from ifconfig
$ ifconfig | jc --ifconfig
no ifconfig options are supported.
or
$ jc ifconfig
Usage (module):

View File

@ -1,10 +1,12 @@
"""jc - JSON CLI output utility INI Parser
"""jc - JSON CLI output utility `INI` file parser
Parses standard `INI` files and files containing simple key/value pairs. Delimiter can be `=` or `:`. Missing values are supported. Comment prefix can be `#` or `;`. Comments must be on their own line.
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):
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.
$ cat foo.ini | jc --ini
Usage (module):

View File

@ -1,10 +1,14 @@
"""jc - JSON CLI output utility ipables Parser
"""jc - JSON CLI output utility `ipables` command output parser
Supports `-vLn` and `--line-numbers` for all tables.
Usage (cli):
Specify --iptables as the first argument if the piped input is coming from iptables
$ sudo iptables -L -t nat | jc --iptables
Supports -vLn and --line-numbers for all tables
or
$ jc iptables -L -t nat
Usage (module):

View File

@ -1,10 +1,14 @@
"""jc - JSON CLI output utility jobs Parser
"""jc - JSON CLI output utility `jobs` command output parser
Also supports the `-l` option.
Usage (cli):
specify --jobs as the first argument if the piped input is coming from jobs
$ jobs | jc --jobs
Also supports the -l option
or
$ jc jobs
Usage (module):

View File

@ -1,10 +1,13 @@
"""jc - JSON CLI output utility Key/Value File Parser
"""jc - JSON CLI output utility `Key/Value` file parser
Supports files containing simple key/value pairs. Delimiter can be `=` or `:`. Missing values are supported. Comment prefix can be `#` or `;`. Comments must be on their own line.
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):
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.
$ cat foo.txt | jc --kv
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility last Parser
"""jc - JSON CLI output utility `last` and `lastb` command output parser
Usage (cli):
specify --last as the first argument if the piped input is coming from last or lastb
$ last | jc --last
or
$ jc last
Usage (module):

View File

@ -1,20 +1,19 @@
"""jc - JSON CLI output utility ls Parser
"""jc - JSON CLI output utility `ls` command output parser
Note: The -l or -b option of ls should be used to correctly parse filenames that include newline characters.
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.
Options supported:
- `lbaR`
- `--time-style=full-iso`
- `-h`: File sizes will be available in text form with `-r` but larger file sizes with human readable suffixes will be converted to `Null` in the default view since the parser attempts to convert this field to an integer.
Note: The `-l` or `-b` option of `ls` should be used to correctly parse filenames that include newline characters. 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 (cli):
specify --ls as the first argument if the piped input is coming from ls
$ ls | jc --ls
ls options supported:
or
-lbaR
--time-style=full-iso
-h file sizes will be available in text form with -r but larger file sizes
with human readable suffixes will be converted to Null in default view
since the parser attempts to convert this field to an integer.
$ jc ls
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility lsblk Parser
"""jc - JSON CLI output utility `lsblk` command output parser
Usage (cli):
specify --lsblk as the first argument if the piped input is coming from lsblk
$ lsblk | jc --lsblk
or
$ jc lsblk
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility lsmod Parser
"""jc - JSON CLI output utility `lsmod` command output parser
Usage (cli):
specify --lsmod as the first argument if the piped input is coming from lsmod
$ lsmod | jc --lsmod
or
$ jc lsmod
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility lsof Parser
"""jc - JSON CLI output utility `lsof` command output parser
Usage (cli):
specify --lsof as the first argument if the piped input is coming from lsof
$ lsof | jc --lsof
or
$ jc lsof
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility mount Parser
"""jc - JSON CLI output utility `mount` command output parser
Usage (cli):
specify --mount as the first argument if the piped input is coming from mount
$ mount | jc --mount
or
$ jc mount
Usage (module):

View File

@ -1,19 +1,22 @@
"""jc - JSON CLI output utility netstat Parser
"""jc - JSON CLI output utility `netstat` command output parser
Caveats:
- Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`)
- Use of the `A` option is not supported on OSX when using the `r` option (e.g. `netstat -rA`)
Usage (cli):
Specify --netstat as the first argument if the piped input is coming from netstat
$ netstat | jc --netstat
or
$ jc 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')
- Use of the 'A' option is not supported on OSX when using the 'r' option (e.g. netstat -rA)
Compatibility:
'linux', 'darwin', 'freebsd'

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility ntpq Parser
"""jc - JSON CLI output utility `ntpq -p` command output parser
Usage (cli):
specify --ntpq as the first argument if the piped input is coming from ntpq -p
$ ntpq -p | jc --ntpq
or
$ jc ntpq -p
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility /etc/passwd file Parser
"""jc - JSON CLI output utility `/etc/passwd` file Parser
Usage (cli):
specify --passwd as the first argument if the piped input is coming from /etc/passwd
$ cat /etc/passwd | jc --passwd
Usage (module):

View File

@ -1,10 +1,16 @@
"""jc - JSON CLI output utility ping Parser
"""jc - JSON CLI output utility `ping` command output parser
Supports `ping` and `ping6` output.
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`.
$ ping -c 3 1.2.3.4 | jc --ping
Note: Use the ping -c (count) option, otherwise data will not be piped to jc.
or
$ jc ping -c 3 1.2.3.4
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility pip-list Parser
"""jc - JSON CLI output utility `pip-list` command output parser
Usage (cli):
specify --pip-list as the first argument if the piped input is coming from pip list
$ pip list | jc --pip-list
or
$ jc pip list
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility pip-show Parser
"""jc - JSON CLI output utility `pip-show` command output parser
Usage (cli):
specify --pip-show as the first argument if the piped input is coming from pip show
$ pip show | jc --pip-show
or
$ jc pip show
Usage (module):

View File

@ -1,12 +1,16 @@
"""jc - JSON CLI output utility ps Parser
"""jc - JSON CLI output utility `ps` command output parser
`ps` options supported:
- `ef`
- `axu`
Usage (cli):
specify --ps as the first argument if the piped input is coming from ps
$ ps | jc --ps
ps options supported:
- ef
- axu
or
$ jc ps
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility route Parser
"""jc - JSON CLI output utility `route` command output parser
Usage (cli):
specify --route as the first argument if the piped input is coming from route
$ route | jc --route
or
$ jc route
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility /etc/shadow file Parser
"""jc - JSON CLI output utility `/etc/shadow` file parser
Usage (cli):
specify --shadow as the first argument if the piped input is coming from /etc/shadow
$ sudo cat /etc/shadow | jc --shadow
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility ss Parser
"""jc - JSON CLI output utility `ss` command output parser
Usage (cli):
specify --ss as the first argument if the piped input is coming from ss
$ ss | jc --ss
or
$ jc ss
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility stat Parser
"""jc - JSON CLI output utility `stat` command output parser
Usage (cli):
specify --stat as the first argument if the piped input is coming from stat
$ stat * | jc --stat
or
$ jc stat *
Usage (module):

View File

@ -1,12 +1,14 @@
"""jc - JSON CLI output utility sysctl -a Parser
"""jc - JSON CLI output utility `sysctl -a` command output parser
Note: Since `sysctl` output is not easily parsable only a very simple key/value object will be output. An attempt is made to convert obvious integers and floats. If no conversion is desired, use the `-r` command-line argument or the `raw=True` argument in `parse()`.
Usage (cli):
specify --sysctl as the first argument if the piped input is coming from sysctl -a
$ sysctl -a | jc --sysctl
Note: since sysctl output is not easily parsable only a very simple key/value object
will be output. An attempt is made to convert obvious integers and floats. If no
conversion is desired, use the -r (raw) option.
or
$ jc sysctl -a
Usage (module):
@ -19,7 +21,7 @@ Compatibility:
Examples:
$ sysctl | jc --sysctl -p
$ sysctl -a | jc --sysctl -p
{
"user.cs_path": "/usr/bin:/bin:/usr/sbin:/sbin",
"user.bc_base_max": 99,
@ -31,7 +33,7 @@ Examples:
...
}
$ sysctl | jc --sysctl -p -r
$ sysctl -a | jc --sysctl -p -r
{
"user.cs_path": "/usr/bin:/bin:/usr/sbin:/sbin",
"user.bc_base_max": "99",

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility systemctl Parser
"""jc - JSON CLI output utility `systemctl` command output parser
Usage (cli):
specify --systemctl as the first argument if the piped input is coming from systemctl
$ systemctl | jc --systemctl
or
$ jc systemctl
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility systemctl-lj Parser
"""jc - JSON CLI output utility `systemctl list-jobs` command output parser
Usage (cli):
specify --systemctl-lj as the first argument if the piped input is coming from systemctl list-jobs
$ systemctl list-jobs | jc --systemctl-lj
or
$ jc systemctl list-jobs
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility systemctl-ls Parser
"""jc - JSON CLI output utility `systemctl list-sockets` command output parser
Usage (cli):
specify --systemctl-ls as the first argument if the piped input is coming from systemctl list-sockets
$ systemctl list-sockets | jc --systemctl-ls
or
$ jc systemctl list-sockets
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility systemctl-luf Parser
"""jc - JSON CLI output utility `systemctl list-unit-files` command output parser
Usage (cli):
specify --systemctl-luf as the first argument if the piped input is coming from systemctl list-unit-files
$ systemctl list-unit-files | jc --systemctl-luf
or
$ jc systemctl list-unit-files
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility timedatectl Parser
"""jc - JSON CLI output utility `timedatectl` command output parser
Usage (cli):
specify --timedatectl as the first argument if the piped input is coming from timedatectl or timedatectl status
$ timedatectl | jc --timedatectl
or
$ jc timedatectl
Usage (module):

View File

@ -1,8 +1,14 @@
"""jc - JSON CLI output utility tracepath Parser
"""jc - JSON CLI output utility `tracepath` command output parser
Supports `tracepath` and `tracepath6` output.
Usage (cli):
specify --tracepath as the first argument if the piped input is coming from tracepath
$ tracepath 1.2.3.4 | jc --tracepath
or
$ jc tracepath 1.2.3.4
Usage (module):

View File

@ -1,14 +1,18 @@
"""jc - JSON CLI output utility traceroute Parser
"""jc - JSON CLI output utility `traceroute` command output parser
Supports `traceroute` and `traceroute6` output.
Note: On some operating systems you will need to redirect `STDERR` to `STDOUT` for destination info since the header line is sent to `STDERR`. A warning message will be printed to `STDERR` if the header row is not found.
e.g. `$ traceroute 8.8.8.8 2>&1 | jc --traceroute`
Usage (cli):
specify --traceroute as the first argument if the piped input is coming from traceroute
$ traceroute 1.2.3.4 | jc --traceroute
Note: On some operating systems you will need to redirect STDERR to STDOUT for destination
info since the header line is sent to STDERR. A warning message will be printed to
STDERR if the header row is not found.
or
e.g. $ traceroute 8.8.8.8 2>&1 | jc --traceroute
$ jc traceroute 1.2.3.4
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility uname Parser
"""jc - JSON CLI output utility `uname -a` command output parser
Usage (cli):
specify --uname as the first argument if the piped input is coming from uname -a
$ uname -a | jc --uname
or
$ jc uname -a
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility uptime Parser
"""jc - JSON CLI output utility `uptime` command output parser
Usage (cli):
specify --uptime as the first argument if the piped input is coming from uptime
$ uptime | jc --uptime
or
$ jc uptime
Usage (module):

View File

@ -1,8 +1,12 @@
"""jc - JSON CLI output utility w Parser
"""jc - JSON CLI output utility `w` command output parser
Usage (cli):
specify --w as the first argument if the piped input is coming from w
$ w | jc --w
or
$ jc w
Usage (module):

View File

@ -1,10 +1,14 @@
"""jc - JSON CLI output utility who Parser
"""jc - JSON CLI output utility `who` command output parser
Accepts any of the following who options (or no options): `-aTH`
Usage (cli):
specify --who as the first argument if the piped input is coming from who
$ who | jc --who
accepts any of the following who options (or no options): -aTH
or
$ jc who
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility XML Parser
"""jc - JSON CLI output utility `XML` file parser
Usage (cli):
specify --xml as the first argument if the piped input is coming from an XML file
$ cat foo.xml| jc --xml
Usage (module):

View File

@ -1,8 +1,8 @@
"""jc - JSON CLI output utility YAML Parser
"""jc - JSON CLI output utility `YAML` file parser
Usage (cli):
specify --yaml as the first argument if the piped input is coming from a YAML file
$ cat foo.yaml| jc --yaml
Usage (module):