mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
make all summary docstrings raw
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `acpi` command output parser
|
r"""jc - JSON Convert `acpi` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `airport -I` command output parser
|
r"""jc - JSON Convert `airport -I` command output parser
|
||||||
|
|
||||||
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
|
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `airport -s` command output parser
|
r"""jc - JSON Convert `airport -s` command output parser
|
||||||
|
|
||||||
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
|
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `apt-cache show` command parser
|
r"""jc - JSON Convert `apt-cache show` command parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `apt-get -sqq` command output parser
|
r"""jc - JSON Convert `apt-get -sqq` command output parser
|
||||||
|
|
||||||
Requires the `-sqq` options in `apt-get`.
|
Requires the `-sqq` options in `apt-get`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `arp` command output parser
|
r"""jc - JSON Convert `arp` command output parser
|
||||||
|
|
||||||
Supports `arp` and `arp -a` output.
|
Supports `arp` and `arp -a` output.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `asciitable` parser
|
r"""jc - JSON Convert `asciitable` parser
|
||||||
|
|
||||||
This parser converts ASCII and Unicode text tables with single-line rows.
|
This parser converts ASCII and Unicode text tables with single-line rows.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `bluetoothctl` command output parser
|
r"""jc - JSON Convert `bluetoothctl` command output parser
|
||||||
|
|
||||||
Supports the following `bluetoothctl` subcommands:
|
Supports the following `bluetoothctl` subcommands:
|
||||||
- `bluetoothctl list`
|
- `bluetoothctl list`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert broken parser - for testing purposes only"""
|
r"""jc - JSON Convert broken parser - for testing purposes only"""
|
||||||
import non_existent_library
|
import non_existent_library
|
||||||
|
|
||||||
class info():
|
class info():
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `cbt` command output parser (Google Bigtable)
|
r"""jc - JSON Convert `cbt` command output parser (Google Bigtable)
|
||||||
|
|
||||||
Parses the human-, but not machine-, friendly output of the cbt command (for
|
Parses the human-, but not machine-, friendly output of the cbt command (for
|
||||||
Google's Bigtable).
|
Google's Bigtable).
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `certbot` command output parser
|
r"""jc - JSON Convert `certbot` command output parser
|
||||||
|
|
||||||
Supports the following `certbot` commands:
|
Supports the following `certbot` commands:
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `chage --list` command output parser
|
r"""jc - JSON Convert `chage --list` command output parser
|
||||||
|
|
||||||
Supports `chage -l <username>` or `chage --list <username>`
|
Supports `chage -l <username>` or `chage --list <username>`
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `cksum` command output parser
|
r"""jc - JSON Convert `cksum` command output parser
|
||||||
|
|
||||||
This parser works with the following checksum calculation utilities:
|
This parser works with the following checksum calculation utilities:
|
||||||
- `sum`
|
- `sum`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert Common Log Format file parser
|
r"""jc - JSON Convert Common Log Format file parser
|
||||||
|
|
||||||
This parser will handle the Common Log Format standard as specified at
|
This parser will handle the Common Log Format standard as specified at
|
||||||
https://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format.
|
https://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert Common Log Format file streaming parser
|
r"""jc - JSON Convert Common Log Format file streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `crontab -l` command output and crontab
|
r"""jc - JSON Convert `crontab -l` command output and crontab
|
||||||
file parser
|
file parser
|
||||||
|
|
||||||
Supports `crontab -l` command output and crontab files.
|
Supports `crontab -l` command output and crontab files.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `crontab -l` command output and crontab
|
r"""jc - JSON Convert `crontab -l` command output and crontab
|
||||||
file parser
|
file parser
|
||||||
|
|
||||||
This version of the `crontab -l` parser supports output that contains user
|
This version of the `crontab -l` parser supports output that contains user
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `csv` file parser
|
r"""jc - JSON Convert `csv` file parser
|
||||||
|
|
||||||
The `csv` parser will attempt to automatically detect the delimiter
|
The `csv` parser will attempt to automatically detect the delimiter
|
||||||
character. If the delimiter cannot be detected it will default to comma.
|
character. If the delimiter cannot be detected it will default to comma.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `csv` file streaming parser
|
r"""jc - JSON Convert `csv` file streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `date` command output parser
|
r"""jc - JSON Convert `date` command output parser
|
||||||
|
|
||||||
The `epoch` calculated timestamp field is naive. (i.e. based on the local
|
The `epoch` calculated timestamp field is naive. (i.e. based on the local
|
||||||
time of the system the parser is run on)
|
time of the system the parser is run on)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert ISO 8601 Datetime string parser
|
r"""jc - JSON Convert ISO 8601 Datetime string parser
|
||||||
|
|
||||||
This parser supports standard ISO 8601 strings that include both date and
|
This parser supports standard ISO 8601 strings that include both date and
|
||||||
time. If no timezone or offset information is available in the string, then
|
time. If no timezone or offset information is available in the string, then
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `debconf-show` command output parser
|
r"""jc - JSON Convert `debconf-show` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `df` command output parser
|
r"""jc - JSON Convert `df` command output parser
|
||||||
|
|
||||||
Values are normalized to bytes when using `df -h`.
|
Values are normalized to bytes when using `df -h`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `dig` command output parser
|
r"""jc - JSON Convert `dig` command output parser
|
||||||
|
|
||||||
Options supported:
|
Options supported:
|
||||||
- `+noall +answer` options are supported in cases where only the answer
|
- `+noall +answer` options are supported in cases where only the answer
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert disabled parser
|
r"""jc - JSON Convert disabled parser
|
||||||
|
|
||||||
This parser has been disabled due to an error in the parser code.
|
This parser has been disabled due to an error in the parser code.
|
||||||
"""
|
"""
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `dmidecode` command output parser
|
r"""jc - JSON Convert `dmidecode` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `dpkg -l` command output parser
|
r"""jc - JSON Convert `dpkg -l` command output parser
|
||||||
|
|
||||||
Set the `COLUMNS` environment variable to a large value to avoid field
|
Set the `COLUMNS` environment variable to a large value to avoid field
|
||||||
truncation. For example:
|
truncation. For example:
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `du` command output parser
|
r"""jc - JSON Convert `du` command output parser
|
||||||
|
|
||||||
The `du -h` option is not supported with the default output. If you
|
The `du -h` option is not supported with the default output. If you
|
||||||
would like to use `du -h` or other options that change the output, be sure
|
would like to use `du -h` or other options that change the output, be sure
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `efibootmgr` command output parser
|
r"""jc - JSON Convert `efibootmgr` command output parser
|
||||||
|
|
||||||
The `-v` option is also supported.
|
The `-v` option is also supported.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert Email Address string parser
|
r"""jc - JSON Convert Email Address string parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `env` and `printenv` command output parser
|
r"""jc - JSON Convert `env` and `printenv` command output parser
|
||||||
|
|
||||||
This parser will output a list of dictionaries each containing `name` and
|
This parser will output a list of dictionaries each containing `name` and
|
||||||
`value` keys. If you would like a simple dictionary output, then use the
|
`value` keys. If you would like a simple dictionary output, then use the
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ethtool` command output parser
|
r"""jc - JSON Convert `ethtool` command output parser
|
||||||
|
|
||||||
Supports standard `ethtool` output and the `--module-info` option.
|
Supports standard `ethtool` output and the `--module-info` option.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `file` command output parser
|
r"""jc - JSON Convert `file` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `find` command output parser
|
r"""jc - JSON Convert `find` command output parser
|
||||||
|
|
||||||
This parser returns a list of objects by default and a list of strings if
|
This parser returns a list of objects by default and a list of strings if
|
||||||
the `--raw` option is used.
|
the `--raw` option is used.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `findmnt` command output parser
|
r"""jc - JSON Convert `findmnt` command output parser
|
||||||
|
|
||||||
Supports `-a`, `-l`, or no `findmnt` options.
|
Supports `-a`, `-l`, or no `findmnt` options.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `finger` command output parser
|
r"""jc - JSON Convert `finger` command output parser
|
||||||
|
|
||||||
Supports `-s` output option. Does not support the `-l` detail option.
|
Supports `-s` output option. Does not support the `-l` detail option.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `foo` command output parser
|
r"""jc - JSON Convert `foo` command output parser
|
||||||
|
|
||||||
<<Short foo description and caveats>>
|
<<Short foo description and caveats>>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `foo` command output streaming parser
|
r"""jc - JSON Convert `foo` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `free` command output parser
|
r"""jc - JSON Convert `free` command output parser
|
||||||
|
|
||||||
Values are normalized to bytes when using `free -h`.
|
Values are normalized to bytes when using `free -h`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `fstab` file parser
|
r"""jc - JSON Convert `fstab` file parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `git log` command output parser
|
r"""jc - JSON Convert `git log` command output parser
|
||||||
|
|
||||||
Can be used with the following format options:
|
Can be used with the following format options:
|
||||||
- `oneline`
|
- `oneline`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `git log` command output streaming parser
|
r"""jc - JSON Convert `git log` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `git ls-remote` command output parser
|
r"""jc - JSON Convert `git ls-remote` command output parser
|
||||||
|
|
||||||
This parser outputs two schemas:
|
This parser outputs two schemas:
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `gpg --with-colons` command output parser
|
r"""jc - JSON Convert `gpg --with-colons` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `/etc/group` file parser
|
r"""jc - JSON Convert `/etc/group` file parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `/etc/gshadow` file parser
|
r"""jc - JSON Convert `/etc/gshadow` file parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `hash` command output parser
|
r"""jc - JSON Convert `hash` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `hash sum` command output parser
|
r"""jc - JSON Convert `hash sum` command output parser
|
||||||
|
|
||||||
This parser works with the following hash calculation utilities:
|
This parser works with the following hash calculation utilities:
|
||||||
- `md5`
|
- `md5`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `hciconfig` command output parser
|
r"""jc - JSON Convert `hciconfig` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `host` command output parser
|
r"""jc - JSON Convert `host` command output parser
|
||||||
|
|
||||||
Supports parsing of the most commonly used RR types (A, AAAA, MX, TXT)
|
Supports parsing of the most commonly used RR types (A, AAAA, MX, TXT)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `/etc/hosts` file parser
|
r"""jc - JSON Convert `/etc/hosts` file parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `id` command output parser
|
r"""jc - JSON Convert `id` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ifconfig` command output parser
|
r"""jc - JSON Convert `ifconfig` command output parser
|
||||||
|
|
||||||
No `ifconfig` options are supported.
|
No `ifconfig` options are supported.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iftop` command output parser
|
r"""jc - JSON Convert `iftop` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert INI file parser
|
r"""jc - JSON Convert INI file parser
|
||||||
|
|
||||||
Parses standard INI files.
|
Parses standard INI files.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert INI with duplicate key file parser
|
r"""jc - JSON Convert INI with duplicate key file parser
|
||||||
|
|
||||||
Parses standard INI files and preserves duplicate values. All values are
|
Parses standard INI files and preserves duplicate values. All values are
|
||||||
contained in lists/arrays.
|
contained in lists/arrays.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iostat` command output parser
|
r"""jc - JSON Convert `iostat` command output parser
|
||||||
|
|
||||||
> Note: `iostat` version 11 and higher include a JSON output option
|
> Note: `iostat` version 11 and higher include a JSON output option
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iostat` command output streaming parser
|
r"""jc - JSON Convert `iostat` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert IP Address string parser
|
r"""jc - JSON Convert IP Address string parser
|
||||||
|
|
||||||
Accepts standard and integer IP address notation for both IPv4 and IPv6
|
Accepts standard and integer IP address notation for both IPv4 and IPv6
|
||||||
addresses. CIDR subnet mask and Scope ID is also allowed for standard
|
addresses. CIDR subnet mask and Scope ID is also allowed for standard
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ip route` command output parser
|
r"""jc - JSON Convert `ip route` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iptables` command output parser
|
r"""jc - JSON Convert `iptables` command output parser
|
||||||
|
|
||||||
Supports `-vLn` and `--line-numbers` for all tables.
|
Supports `-vLn` and `--line-numbers` for all tables.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iw dev <device> scan` command output parser
|
r"""jc - JSON Convert `iw dev <device> scan` command output parser
|
||||||
|
|
||||||
This parser is considered beta quality. Not all fields are parsed and there
|
This parser is considered beta quality. Not all fields are parsed and there
|
||||||
are not enough samples to test.
|
are not enough samples to test.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `iwconfig` command output parser
|
r"""jc - JSON Convert `iwconfig` command output parser
|
||||||
|
|
||||||
No `iwconfig` options are supported.
|
No `iwconfig` options are supported.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `jobs` command output parser
|
r"""jc - JSON Convert `jobs` command output parser
|
||||||
|
|
||||||
Also supports the `-l` option.
|
Also supports the `-l` option.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert JWT string parser
|
r"""jc - JSON Convert JWT string parser
|
||||||
|
|
||||||
> Note: `jc` will not check the integrity of the JWT payload.
|
> Note: `jc` will not check the integrity of the JWT payload.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `Key/Value` file and string parser
|
r"""jc - JSON Convert `Key/Value` file and string parser
|
||||||
|
|
||||||
Supports files containing simple key/value pairs.
|
Supports files containing simple key/value pairs.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `Key/Value` with duplicate key file and string parser
|
r"""jc - JSON Convert `Key/Value` with duplicate key file and string parser
|
||||||
|
|
||||||
Supports files containing simple key/value pairs and preserves duplicate
|
Supports files containing simple key/value pairs and preserves duplicate
|
||||||
values. All values are contained in lists/arrays.
|
values. All values are contained in lists/arrays.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `last` and `lastb` command output parser
|
r"""jc - JSON Convert `last` and `lastb` command output parser
|
||||||
|
|
||||||
Supports `-w`, `-F`, and `-x` options.
|
Supports `-w`, `-F`, and `-x` options.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ls` and `vdir` command output parser
|
r"""jc - JSON Convert `ls` and `vdir` command output parser
|
||||||
|
|
||||||
Options supported:
|
Options supported:
|
||||||
- `lbaR1`
|
- `lbaR1`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ls` and `vdir` command output streaming parser
|
r"""jc - JSON Convert `ls` and `vdir` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,162 +1,162 @@
|
|||||||
"""jc - JSON Convert `lsattr` command output parser
|
r"""jc - JSON Convert `lsattr` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
$ lsattr | jc --lsattr
|
$ lsattr | jc --lsattr
|
||||||
|
|
||||||
or
|
or
|
||||||
|
|
||||||
$ jc lsattr
|
$ jc lsattr
|
||||||
|
|
||||||
Usage (module):
|
Usage (module):
|
||||||
|
|
||||||
import jc
|
import jc
|
||||||
result = jc.parse('lsattr', lsattr_command_output)
|
result = jc.parse('lsattr', lsattr_command_output)
|
||||||
|
|
||||||
Schema:
|
Schema:
|
||||||
|
|
||||||
Information from https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40
|
Information from https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40
|
||||||
used to define field names
|
used to define field names
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"file": string,
|
"file": string,
|
||||||
"compressed_file": Optional[boolean],
|
"compressed_file": Optional[boolean],
|
||||||
"compressed_dirty_file": Optional[boolean],
|
"compressed_dirty_file": Optional[boolean],
|
||||||
"compression_raw_access": Optional[boolean],
|
"compression_raw_access": Optional[boolean],
|
||||||
"secure_deletion": Optional[boolean],
|
"secure_deletion": Optional[boolean],
|
||||||
"undelete": Optional[boolean],
|
"undelete": Optional[boolean],
|
||||||
"synchronous_updates": Optional[boolean],
|
"synchronous_updates": Optional[boolean],
|
||||||
"synchronous_directory_updates": Optional[boolean],
|
"synchronous_directory_updates": Optional[boolean],
|
||||||
"immutable": Optional[boolean],
|
"immutable": Optional[boolean],
|
||||||
"append_only": Optional[boolean],
|
"append_only": Optional[boolean],
|
||||||
"no_dump": Optional[boolean],
|
"no_dump": Optional[boolean],
|
||||||
"no_atime": Optional[boolean],
|
"no_atime": Optional[boolean],
|
||||||
"compression_requested": Optional[boolean],
|
"compression_requested": Optional[boolean],
|
||||||
"encrypted": Optional[boolean],
|
"encrypted": Optional[boolean],
|
||||||
"journaled_data": Optional[boolean],
|
"journaled_data": Optional[boolean],
|
||||||
"indexed_directory": Optional[boolean],
|
"indexed_directory": Optional[boolean],
|
||||||
"no_tailmerging": Optional[boolean],
|
"no_tailmerging": Optional[boolean],
|
||||||
"top_of_directory_hierarchies": Optional[boolean],
|
"top_of_directory_hierarchies": Optional[boolean],
|
||||||
"extents": Optional[boolean],
|
"extents": Optional[boolean],
|
||||||
"no_cow": Optional[boolean],
|
"no_cow": Optional[boolean],
|
||||||
"casefold": Optional[boolean],
|
"casefold": Optional[boolean],
|
||||||
"inline_data": Optional[boolean],
|
"inline_data": Optional[boolean],
|
||||||
"project_hierarchy": Optional[boolean],
|
"project_hierarchy": Optional[boolean],
|
||||||
"verity": Optional[boolean],
|
"verity": Optional[boolean],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
$ sudo lsattr /etc/passwd | jc --lsattr
|
$ sudo lsattr /etc/passwd | jc --lsattr
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"file": "/etc/passwd",
|
"file": "/etc/passwd",
|
||||||
"extents": true
|
"extents": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
"""
|
"""
|
||||||
from typing import List, Dict
|
from typing import List, Dict
|
||||||
from jc.jc_types import JSONDictType
|
from jc.jc_types import JSONDictType
|
||||||
import jc.utils
|
import jc.utils
|
||||||
|
|
||||||
|
|
||||||
class info():
|
class info():
|
||||||
"""Provides parser metadata (version, author, etc.)"""
|
"""Provides parser metadata (version, author, etc.)"""
|
||||||
version = '1.0'
|
version = '1.0'
|
||||||
description = '`lsattr` command parser'
|
description = '`lsattr` command parser'
|
||||||
author = 'Mark Rotner'
|
author = 'Mark Rotner'
|
||||||
author_email = 'rotner.mr@gmail.com'
|
author_email = 'rotner.mr@gmail.com'
|
||||||
compatible = ['linux']
|
compatible = ['linux']
|
||||||
magic_commands = ['lsattr']
|
magic_commands = ['lsattr']
|
||||||
tags = ['command']
|
tags = ['command']
|
||||||
|
|
||||||
|
|
||||||
__version__ = info.version
|
__version__ = info.version
|
||||||
|
|
||||||
|
|
||||||
ERROR_PREFIX = "lsattr:"
|
ERROR_PREFIX = "lsattr:"
|
||||||
|
|
||||||
# https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40
|
# https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40
|
||||||
# https://github.com/landley/toybox/blob/f1682dc79fd75f64042b5438918fe5a507977e1c/toys/other/lsattr.c#L97
|
# https://github.com/landley/toybox/blob/f1682dc79fd75f64042b5438918fe5a507977e1c/toys/other/lsattr.c#L97
|
||||||
ATTRIBUTES = {
|
ATTRIBUTES = {
|
||||||
"B": "compressed_file",
|
"B": "compressed_file",
|
||||||
"Z": "compressed_dirty_file",
|
"Z": "compressed_dirty_file",
|
||||||
"X": "compression_raw_access",
|
"X": "compression_raw_access",
|
||||||
"s": "secure_deletion",
|
"s": "secure_deletion",
|
||||||
"u": "undelete",
|
"u": "undelete",
|
||||||
"S": "synchronous_updates",
|
"S": "synchronous_updates",
|
||||||
"D": "synchronous_directory_updates",
|
"D": "synchronous_directory_updates",
|
||||||
"i": "immutable",
|
"i": "immutable",
|
||||||
"a": "append_only",
|
"a": "append_only",
|
||||||
"d": "no_dump",
|
"d": "no_dump",
|
||||||
"A": "no_atime",
|
"A": "no_atime",
|
||||||
"c": "compression_requested",
|
"c": "compression_requested",
|
||||||
"E": "encrypted",
|
"E": "encrypted",
|
||||||
"j": "journaled_data",
|
"j": "journaled_data",
|
||||||
"I": "indexed_directory",
|
"I": "indexed_directory",
|
||||||
"t": "no_tailmerging",
|
"t": "no_tailmerging",
|
||||||
"T": "top_of_directory_hierarchies",
|
"T": "top_of_directory_hierarchies",
|
||||||
"e": "extents",
|
"e": "extents",
|
||||||
"C": "no_cow",
|
"C": "no_cow",
|
||||||
"F": "casefold",
|
"F": "casefold",
|
||||||
"N": "inline_data",
|
"N": "inline_data",
|
||||||
"P": "project_hierarchy",
|
"P": "project_hierarchy",
|
||||||
"V": "verity",
|
"V": "verity",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
def parse(
|
def parse(
|
||||||
data: str,
|
data: str,
|
||||||
raw: bool = False,
|
raw: bool = False,
|
||||||
quiet: bool = False
|
quiet: bool = False
|
||||||
) -> List[JSONDictType]:
|
) -> List[JSONDictType]:
|
||||||
"""
|
"""
|
||||||
Main text parsing function
|
Main text parsing function
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
|
||||||
data: (string) text data to parse
|
data: (string) text data to parse
|
||||||
quiet: (boolean) suppress warning messages if True
|
quiet: (boolean) suppress warning messages if True
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
|
||||||
List of Dictionaries. Raw or processed structured data.
|
List of Dictionaries. Raw or processed structured data.
|
||||||
"""
|
"""
|
||||||
jc.utils.compatibility(__name__, info.compatible, quiet)
|
jc.utils.compatibility(__name__, info.compatible, quiet)
|
||||||
jc.utils.input_type_check(data)
|
jc.utils.input_type_check(data)
|
||||||
|
|
||||||
output: List = []
|
output: List = []
|
||||||
|
|
||||||
cleandata = list(filter(None, data.splitlines()))
|
cleandata = list(filter(None, data.splitlines()))
|
||||||
|
|
||||||
if not jc.utils.has_data(data):
|
if not jc.utils.has_data(data):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
for line in cleandata:
|
for line in cleandata:
|
||||||
# -R flag returns the output in the format:
|
# -R flag returns the output in the format:
|
||||||
# Folder:
|
# Folder:
|
||||||
# attributes file_in_folder
|
# attributes file_in_folder
|
||||||
if line.endswith(':'):
|
if line.endswith(':'):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# lsattr: Operation not supported ....
|
# lsattr: Operation not supported ....
|
||||||
if line.startswith(ERROR_PREFIX):
|
if line.startswith(ERROR_PREFIX):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
line_output: Dict = {}
|
line_output: Dict = {}
|
||||||
|
|
||||||
# attributes file
|
# attributes file
|
||||||
# --------------e----- /etc/passwd
|
# --------------e----- /etc/passwd
|
||||||
attributes, file = line.split()
|
attributes, file = line.split()
|
||||||
line_output['file'] = file
|
line_output['file'] = file
|
||||||
for attribute in list(attributes):
|
for attribute in list(attributes):
|
||||||
attribute_key = ATTRIBUTES.get(attribute)
|
attribute_key = ATTRIBUTES.get(attribute)
|
||||||
if attribute_key:
|
if attribute_key:
|
||||||
line_output[attribute_key] = True
|
line_output[attribute_key] = True
|
||||||
|
|
||||||
if line_output:
|
if line_output:
|
||||||
output.append(line_output)
|
output.append(line_output)
|
||||||
|
|
||||||
return output
|
return output
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `lsb_release` command parser
|
r"""jc - JSON Convert `lsb_release` command parser
|
||||||
|
|
||||||
This parser is an alias to the Key/Value parser (`--kv`).
|
This parser is an alias to the Key/Value parser (`--kv`).
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `lsmod` command output parser
|
r"""jc - JSON Convert `lsmod` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `lsof` command output parser
|
r"""jc - JSON Convert `lsof` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `lspci -mmv` command output parser
|
r"""jc - JSON Convert `lspci -mmv` command output parser
|
||||||
|
|
||||||
This parser supports the following `lspci` options:
|
This parser supports the following `lspci` options:
|
||||||
- `-mmv`
|
- `-mmv`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `lsusb` command output parser
|
r"""jc - JSON Convert `lsusb` command output parser
|
||||||
|
|
||||||
Supports the `-v` option or no options.
|
Supports the `-v` option or no options.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `mdadm` command output parser
|
r"""jc - JSON Convert `mdadm` command output parser
|
||||||
|
|
||||||
Supports the `--query` and `--examine` options in `mdadm`.
|
Supports the `--query` and `--examine` options in `mdadm`.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `mount` command output parser
|
r"""jc - JSON Convert `mount` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `mpstat` command output parser
|
r"""jc - JSON Convert `mpstat` command output parser
|
||||||
|
|
||||||
> Note: Latest versions of `mpstat` support JSON output (v11.5.1+)
|
> Note: Latest versions of `mpstat` support JSON output (v11.5.1+)
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `mpstat` command output streaming parser
|
r"""jc - JSON Convert `mpstat` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `needrestart -b` command output parser
|
r"""jc - JSON Convert `needrestart -b` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `netstat` command output parser
|
r"""jc - JSON Convert `netstat` command output parser
|
||||||
|
|
||||||
Caveats:
|
Caveats:
|
||||||
- Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`)
|
- Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert FreeBSD and OSX netstat Parser"""
|
r"""jc - JSON Convert FreeBSD and OSX netstat Parser"""
|
||||||
|
|
||||||
|
|
||||||
def normalize_headers(header):
|
def normalize_headers(header):
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert Linux netstat Parser"""
|
r"""jc - JSON Convert Linux netstat Parser"""
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""
|
r"""
|
||||||
jc - JSON Convert Windows `netstat` command output parser
|
jc - JSON Convert Windows `netstat` command output parser
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `nmcli` command output parser
|
r"""jc - JSON Convert `nmcli` command output parser
|
||||||
|
|
||||||
Supports the following `nmcli` subcommands:
|
Supports the following `nmcli` subcommands:
|
||||||
- `nmcli general`
|
- `nmcli general`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `nsd-control` command output parser
|
r"""jc - JSON Convert `nsd-control` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ntpq -p` command output parser
|
r"""jc - JSON Convert `ntpq -p` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert openvpn-status.log file parser
|
r"""jc - JSON Convert openvpn-status.log file parser
|
||||||
|
|
||||||
The `*_epoch` calculated timestamp fields are naive. (i.e. based on
|
The `*_epoch` calculated timestamp fields are naive. (i.e. based on
|
||||||
the local time of the system the parser is run on)
|
the local time of the system the parser is run on)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `os-prober` command output parser
|
r"""jc - JSON Convert `os-prober` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `/etc/passwd` file Parser
|
r"""jc - JSON Convert `/etc/passwd` file Parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert POSIX path string parser
|
r"""jc - JSON Convert POSIX path string parser
|
||||||
|
|
||||||
Parse a POSIX path.
|
Parse a POSIX path.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert POSIX path list string parser
|
r"""jc - JSON Convert POSIX path list string parser
|
||||||
|
|
||||||
Parse a colon-separated POSIX path list, commonly found in environment
|
Parse a colon-separated POSIX path list, commonly found in environment
|
||||||
variables.
|
variables.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `pci.ids` file parser
|
r"""jc - JSON Convert `pci.ids` file parser
|
||||||
|
|
||||||
This parser converts the pci.ids database file.
|
This parser converts the pci.ids database file.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert PostgreSQL password file parser
|
r"""jc - JSON Convert PostgreSQL password file parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `pidstat -H` command output parser
|
r"""jc - JSON Convert `pidstat -H` command output parser
|
||||||
|
|
||||||
Must use the `-H` (or `-h`, if `-H` is not available) option in `pidstat`.
|
Must use the `-H` (or `-h`, if `-H` is not available) option in `pidstat`.
|
||||||
All other `pidstat` options are supported in combination with this option.
|
All other `pidstat` options are supported in combination with this option.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `pidstat -H` command output streaming parser
|
r"""jc - JSON Convert `pidstat -H` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ping` command output parser
|
r"""jc - JSON Convert `ping` command output parser
|
||||||
|
|
||||||
Supports `ping` and `ping6` output.
|
Supports `ping` and `ping6` output.
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `ping` command output streaming parser
|
r"""jc - JSON Convert `ping` command output streaming parser
|
||||||
|
|
||||||
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
> This streaming parser outputs JSON Lines (cli) or returns an Iterable of
|
||||||
> Dictionaries (module)
|
> Dictionaries (module)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""jc - JSON Convert `pip-list` command output parser
|
r"""jc - JSON Convert `pip-list` command output parser
|
||||||
|
|
||||||
Usage (cli):
|
Usage (cli):
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user