diff --git a/jc/parsers/acpi.py b/jc/parsers/acpi.py index 8b3a080d..e8a96336 100644 --- a/jc/parsers/acpi.py +++ b/jc/parsers/acpi.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `acpi` command output parser +r"""jc - JSON Convert `acpi` command output parser Usage (cli): diff --git a/jc/parsers/airport.py b/jc/parsers/airport.py index 696100f8..3c3d7e69 100644 --- a/jc/parsers/airport.py +++ b/jc/parsers/airport.py @@ -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`. diff --git a/jc/parsers/airport_s.py b/jc/parsers/airport_s.py index 802c726e..d804226b 100644 --- a/jc/parsers/airport_s.py +++ b/jc/parsers/airport_s.py @@ -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`. diff --git a/jc/parsers/apt_cache_show.py b/jc/parsers/apt_cache_show.py index 86cbe3e7..62ede53a 100644 --- a/jc/parsers/apt_cache_show.py +++ b/jc/parsers/apt_cache_show.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `apt-cache show` command parser +r"""jc - JSON Convert `apt-cache show` command parser Usage (cli): diff --git a/jc/parsers/apt_get_sqq.py b/jc/parsers/apt_get_sqq.py index 4a6663a3..77001cb9 100644 --- a/jc/parsers/apt_get_sqq.py +++ b/jc/parsers/apt_get_sqq.py @@ -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`. diff --git a/jc/parsers/arp.py b/jc/parsers/arp.py index db00708d..be0b6edc 100644 --- a/jc/parsers/arp.py +++ b/jc/parsers/arp.py @@ -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. diff --git a/jc/parsers/asciitable.py b/jc/parsers/asciitable.py index b7da4b94..4e2768c7 100644 --- a/jc/parsers/asciitable.py +++ b/jc/parsers/asciitable.py @@ -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. diff --git a/jc/parsers/bluetoothctl.py b/jc/parsers/bluetoothctl.py index da3209e0..24fc553e 100644 --- a/jc/parsers/bluetoothctl.py +++ b/jc/parsers/bluetoothctl.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `bluetoothctl` command output parser +r"""jc - JSON Convert `bluetoothctl` command output parser Supports the following `bluetoothctl` subcommands: - `bluetoothctl list` diff --git a/jc/parsers/broken_parser.py b/jc/parsers/broken_parser.py index ded316ed..475b460d 100644 --- a/jc/parsers/broken_parser.py +++ b/jc/parsers/broken_parser.py @@ -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 class info(): diff --git a/jc/parsers/cbt.py b/jc/parsers/cbt.py index 184993fa..7296b41a 100644 --- a/jc/parsers/cbt.py +++ b/jc/parsers/cbt.py @@ -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 Google's Bigtable). diff --git a/jc/parsers/certbot.py b/jc/parsers/certbot.py index 1bf442c0..99ae223c 100644 --- a/jc/parsers/certbot.py +++ b/jc/parsers/certbot.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `certbot` command output parser +r"""jc - JSON Convert `certbot` command output parser Supports the following `certbot` commands: diff --git a/jc/parsers/chage.py b/jc/parsers/chage.py index ad24cffa..35a43fe6 100644 --- a/jc/parsers/chage.py +++ b/jc/parsers/chage.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `chage --list` command output parser +r"""jc - JSON Convert `chage --list` command output parser Supports `chage -l ` or `chage --list ` diff --git a/jc/parsers/cksum.py b/jc/parsers/cksum.py index 4e798474..463380f1 100644 --- a/jc/parsers/cksum.py +++ b/jc/parsers/cksum.py @@ -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: - `sum` diff --git a/jc/parsers/clf.py b/jc/parsers/clf.py index 374553ce..fed1d94c 100644 --- a/jc/parsers/clf.py +++ b/jc/parsers/clf.py @@ -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 https://www.w3.org/Daemon/User/Config/Logging.html#common-logfile-format. diff --git a/jc/parsers/clf_s.py b/jc/parsers/clf_s.py index fc43ed1e..2debae02 100644 --- a/jc/parsers/clf_s.py +++ b/jc/parsers/clf_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/crontab.py b/jc/parsers/crontab.py index 78ff5336..0df442d1 100644 --- a/jc/parsers/crontab.py +++ b/jc/parsers/crontab.py @@ -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 Supports `crontab -l` command output and crontab files. diff --git a/jc/parsers/crontab_u.py b/jc/parsers/crontab_u.py index 0379d6c3..5d20ec9d 100644 --- a/jc/parsers/crontab_u.py +++ b/jc/parsers/crontab_u.py @@ -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 This version of the `crontab -l` parser supports output that contains user diff --git a/jc/parsers/csv.py b/jc/parsers/csv.py index e97e9669..7d56fe3a 100644 --- a/jc/parsers/csv.py +++ b/jc/parsers/csv.py @@ -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 character. If the delimiter cannot be detected it will default to comma. diff --git a/jc/parsers/csv_s.py b/jc/parsers/csv_s.py index 9eaf1a1b..5fa0be35 100644 --- a/jc/parsers/csv_s.py +++ b/jc/parsers/csv_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/date.py b/jc/parsers/date.py index abcc3e7a..931cf5df 100644 --- a/jc/parsers/date.py +++ b/jc/parsers/date.py @@ -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 time of the system the parser is run on) diff --git a/jc/parsers/datetime_iso.py b/jc/parsers/datetime_iso.py index 6fddff33..f092b1aa 100644 --- a/jc/parsers/datetime_iso.py +++ b/jc/parsers/datetime_iso.py @@ -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 time. If no timezone or offset information is available in the string, then diff --git a/jc/parsers/debconf_show.py b/jc/parsers/debconf_show.py index a4dfc8d6..b7a366cb 100644 --- a/jc/parsers/debconf_show.py +++ b/jc/parsers/debconf_show.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `debconf-show` command output parser +r"""jc - JSON Convert `debconf-show` command output parser Usage (cli): diff --git a/jc/parsers/df.py b/jc/parsers/df.py index ca8ce335..fbe1ca80 100644 --- a/jc/parsers/df.py +++ b/jc/parsers/df.py @@ -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`. diff --git a/jc/parsers/dig.py b/jc/parsers/dig.py index cc146019..172ebeba 100644 --- a/jc/parsers/dig.py +++ b/jc/parsers/dig.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `dig` command output parser +r"""jc - JSON Convert `dig` command output parser Options supported: - `+noall +answer` options are supported in cases where only the answer diff --git a/jc/parsers/disabled_parser.py b/jc/parsers/disabled_parser.py index 1ed79a89..b68a4879 100644 --- a/jc/parsers/disabled_parser.py +++ b/jc/parsers/disabled_parser.py @@ -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. """ diff --git a/jc/parsers/dmidecode.py b/jc/parsers/dmidecode.py index 98a342e3..043f715a 100644 --- a/jc/parsers/dmidecode.py +++ b/jc/parsers/dmidecode.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `dmidecode` command output parser +r"""jc - JSON Convert `dmidecode` command output parser Usage (cli): diff --git a/jc/parsers/dpkg_l.py b/jc/parsers/dpkg_l.py index 6375c608..26d87029 100644 --- a/jc/parsers/dpkg_l.py +++ b/jc/parsers/dpkg_l.py @@ -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 truncation. For example: diff --git a/jc/parsers/du.py b/jc/parsers/du.py index f55edda2..ad600fc1 100644 --- a/jc/parsers/du.py +++ b/jc/parsers/du.py @@ -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 would like to use `du -h` or other options that change the output, be sure diff --git a/jc/parsers/efibootmgr.py b/jc/parsers/efibootmgr.py index 0d5b7015..0850c54e 100644 --- a/jc/parsers/efibootmgr.py +++ b/jc/parsers/efibootmgr.py @@ -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. diff --git a/jc/parsers/email_address.py b/jc/parsers/email_address.py index 9dd6833f..ea8e89f1 100644 --- a/jc/parsers/email_address.py +++ b/jc/parsers/email_address.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Email Address string parser +r"""jc - JSON Convert Email Address string parser Usage (cli): diff --git a/jc/parsers/env.py b/jc/parsers/env.py index 4f2280c8..68d08af6 100644 --- a/jc/parsers/env.py +++ b/jc/parsers/env.py @@ -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 `value` keys. If you would like a simple dictionary output, then use the diff --git a/jc/parsers/ethtool.py b/jc/parsers/ethtool.py index 2b442c68..d6a52fa8 100644 --- a/jc/parsers/ethtool.py +++ b/jc/parsers/ethtool.py @@ -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. diff --git a/jc/parsers/file.py b/jc/parsers/file.py index 264ccb3a..22702825 100644 --- a/jc/parsers/file.py +++ b/jc/parsers/file.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `file` command output parser +r"""jc - JSON Convert `file` command output parser Usage (cli): diff --git a/jc/parsers/find.py b/jc/parsers/find.py index 059cf30d..087995ac 100644 --- a/jc/parsers/find.py +++ b/jc/parsers/find.py @@ -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 the `--raw` option is used. diff --git a/jc/parsers/findmnt.py b/jc/parsers/findmnt.py index 4d18c4f1..a8113c6c 100644 --- a/jc/parsers/findmnt.py +++ b/jc/parsers/findmnt.py @@ -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. diff --git a/jc/parsers/finger.py b/jc/parsers/finger.py index f46df76e..8b680279 100644 --- a/jc/parsers/finger.py +++ b/jc/parsers/finger.py @@ -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. diff --git a/jc/parsers/foo.py b/jc/parsers/foo.py index 8188e517..afcb2a06 100644 --- a/jc/parsers/foo.py +++ b/jc/parsers/foo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `foo` command output parser +r"""jc - JSON Convert `foo` command output parser <> diff --git a/jc/parsers/foo_s.py b/jc/parsers/foo_s.py index 5d62c62f..145871eb 100644 --- a/jc/parsers/foo_s.py +++ b/jc/parsers/foo_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/free.py b/jc/parsers/free.py index 31d813a4..55405f4c 100644 --- a/jc/parsers/free.py +++ b/jc/parsers/free.py @@ -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`. diff --git a/jc/parsers/fstab.py b/jc/parsers/fstab.py index c5618696..24242514 100644 --- a/jc/parsers/fstab.py +++ b/jc/parsers/fstab.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `fstab` file parser +r"""jc - JSON Convert `fstab` file parser Usage (cli): diff --git a/jc/parsers/git_log.py b/jc/parsers/git_log.py index 8ad91dbd..e1f0ea49 100644 --- a/jc/parsers/git_log.py +++ b/jc/parsers/git_log.py @@ -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: - `oneline` diff --git a/jc/parsers/git_log_s.py b/jc/parsers/git_log_s.py index e7b02a5a..cb39e8b2 100644 --- a/jc/parsers/git_log_s.py +++ b/jc/parsers/git_log_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/git_ls_remote.py b/jc/parsers/git_ls_remote.py index e05c8993..8af4aa49 100644 --- a/jc/parsers/git_ls_remote.py +++ b/jc/parsers/git_ls_remote.py @@ -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: diff --git a/jc/parsers/gpg.py b/jc/parsers/gpg.py index 21eb32fa..2d8502bb 100644 --- a/jc/parsers/gpg.py +++ b/jc/parsers/gpg.py @@ -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): diff --git a/jc/parsers/group.py b/jc/parsers/group.py index 6bf65f52..13aeaf5e 100644 --- a/jc/parsers/group.py +++ b/jc/parsers/group.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/group` file parser +r"""jc - JSON Convert `/etc/group` file parser Usage (cli): diff --git a/jc/parsers/gshadow.py b/jc/parsers/gshadow.py index b2b87dea..b5d50ca1 100644 --- a/jc/parsers/gshadow.py +++ b/jc/parsers/gshadow.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/gshadow` file parser +r"""jc - JSON Convert `/etc/gshadow` file parser Usage (cli): diff --git a/jc/parsers/hash.py b/jc/parsers/hash.py index c88b87a9..8e79c78d 100644 --- a/jc/parsers/hash.py +++ b/jc/parsers/hash.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `hash` command output parser +r"""jc - JSON Convert `hash` command output parser Usage (cli): diff --git a/jc/parsers/hashsum.py b/jc/parsers/hashsum.py index be47b742..d8633997 100644 --- a/jc/parsers/hashsum.py +++ b/jc/parsers/hashsum.py @@ -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: - `md5` diff --git a/jc/parsers/hciconfig.py b/jc/parsers/hciconfig.py index 7b769172..15820eab 100644 --- a/jc/parsers/hciconfig.py +++ b/jc/parsers/hciconfig.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `hciconfig` command output parser +r"""jc - JSON Convert `hciconfig` command output parser Usage (cli): diff --git a/jc/parsers/host.py b/jc/parsers/host.py index a026a0b5..40a878ac 100644 --- a/jc/parsers/host.py +++ b/jc/parsers/host.py @@ -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) diff --git a/jc/parsers/hosts.py b/jc/parsers/hosts.py index bb5dd009..b9b2efff 100644 --- a/jc/parsers/hosts.py +++ b/jc/parsers/hosts.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/hosts` file parser +r"""jc - JSON Convert `/etc/hosts` file parser Usage (cli): diff --git a/jc/parsers/id.py b/jc/parsers/id.py index d77961a4..da3d261f 100644 --- a/jc/parsers/id.py +++ b/jc/parsers/id.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `id` command output parser +r"""jc - JSON Convert `id` command output parser Usage (cli): diff --git a/jc/parsers/ifconfig.py b/jc/parsers/ifconfig.py index 6192d699..d24b9147 100644 --- a/jc/parsers/ifconfig.py +++ b/jc/parsers/ifconfig.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ifconfig` command output parser +r"""jc - JSON Convert `ifconfig` command output parser No `ifconfig` options are supported. diff --git a/jc/parsers/iftop.py b/jc/parsers/iftop.py index 3439507c..ca1fe556 100644 --- a/jc/parsers/iftop.py +++ b/jc/parsers/iftop.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `iftop` command output parser +r"""jc - JSON Convert `iftop` command output parser Usage (cli): diff --git a/jc/parsers/ini.py b/jc/parsers/ini.py index 21ce3cf4..6455e324 100644 --- a/jc/parsers/ini.py +++ b/jc/parsers/ini.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert INI file parser +r"""jc - JSON Convert INI file parser Parses standard INI files. diff --git a/jc/parsers/ini_dup.py b/jc/parsers/ini_dup.py index bb94ea43..f8dbd148 100644 --- a/jc/parsers/ini_dup.py +++ b/jc/parsers/ini_dup.py @@ -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 contained in lists/arrays. diff --git a/jc/parsers/iostat.py b/jc/parsers/iostat.py index 0a4b4107..74675980 100644 --- a/jc/parsers/iostat.py +++ b/jc/parsers/iostat.py @@ -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 diff --git a/jc/parsers/iostat_s.py b/jc/parsers/iostat_s.py index c2f5921f..3fa92a53 100644 --- a/jc/parsers/iostat_s.py +++ b/jc/parsers/iostat_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/ip_address.py b/jc/parsers/ip_address.py index 991159c1..7e6b37cb 100644 --- a/jc/parsers/ip_address.py +++ b/jc/parsers/ip_address.py @@ -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 addresses. CIDR subnet mask and Scope ID is also allowed for standard diff --git a/jc/parsers/ip_route.py b/jc/parsers/ip_route.py index 0396dd32..eedd9422 100644 --- a/jc/parsers/ip_route.py +++ b/jc/parsers/ip_route.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ip route` command output parser +r"""jc - JSON Convert `ip route` command output parser Usage (cli): diff --git a/jc/parsers/iptables.py b/jc/parsers/iptables.py index 893a0476..a2d52ea6 100644 --- a/jc/parsers/iptables.py +++ b/jc/parsers/iptables.py @@ -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. diff --git a/jc/parsers/iw_scan.py b/jc/parsers/iw_scan.py index 8b936807..90e008af 100644 --- a/jc/parsers/iw_scan.py +++ b/jc/parsers/iw_scan.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `iw dev scan` command output parser +r"""jc - JSON Convert `iw dev scan` command output parser This parser is considered beta quality. Not all fields are parsed and there are not enough samples to test. diff --git a/jc/parsers/iwconfig.py b/jc/parsers/iwconfig.py index 56fff475..e4bd43bf 100644 --- a/jc/parsers/iwconfig.py +++ b/jc/parsers/iwconfig.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `iwconfig` command output parser +r"""jc - JSON Convert `iwconfig` command output parser No `iwconfig` options are supported. diff --git a/jc/parsers/jobs.py b/jc/parsers/jobs.py index 0befa601..7815ab59 100644 --- a/jc/parsers/jobs.py +++ b/jc/parsers/jobs.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `jobs` command output parser +r"""jc - JSON Convert `jobs` command output parser Also supports the `-l` option. diff --git a/jc/parsers/jwt.py b/jc/parsers/jwt.py index c1658cfa..8356d9ea 100644 --- a/jc/parsers/jwt.py +++ b/jc/parsers/jwt.py @@ -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. diff --git a/jc/parsers/kv.py b/jc/parsers/kv.py index c4ede399..4fe3156f 100644 --- a/jc/parsers/kv.py +++ b/jc/parsers/kv.py @@ -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. diff --git a/jc/parsers/kv_dup.py b/jc/parsers/kv_dup.py index f457c69d..417a3805 100644 --- a/jc/parsers/kv_dup.py +++ b/jc/parsers/kv_dup.py @@ -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 values. All values are contained in lists/arrays. diff --git a/jc/parsers/last.py b/jc/parsers/last.py index 868ca124..821f8eb9 100644 --- a/jc/parsers/last.py +++ b/jc/parsers/last.py @@ -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. diff --git a/jc/parsers/ls.py b/jc/parsers/ls.py index 85a69e42..4be45e89 100644 --- a/jc/parsers/ls.py +++ b/jc/parsers/ls.py @@ -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: - `lbaR1` diff --git a/jc/parsers/ls_s.py b/jc/parsers/ls_s.py index 8cf2213d..6f4b8e09 100644 --- a/jc/parsers/ls_s.py +++ b/jc/parsers/ls_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/lsattr.py b/jc/parsers/lsattr.py index 30d60945..dc3a3794 100644 --- a/jc/parsers/lsattr.py +++ b/jc/parsers/lsattr.py @@ -1,162 +1,162 @@ -"""jc - JSON Convert `lsattr` command output parser - -Usage (cli): - - $ lsattr | jc --lsattr - -or - - $ jc lsattr - -Usage (module): - - import jc - result = jc.parse('lsattr', lsattr_command_output) - -Schema: - -Information from https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40 -used to define field names - - [ - { - "file": string, - "compressed_file": Optional[boolean], - "compressed_dirty_file": Optional[boolean], - "compression_raw_access": Optional[boolean], - "secure_deletion": Optional[boolean], - "undelete": Optional[boolean], - "synchronous_updates": Optional[boolean], - "synchronous_directory_updates": Optional[boolean], - "immutable": Optional[boolean], - "append_only": Optional[boolean], - "no_dump": Optional[boolean], - "no_atime": Optional[boolean], - "compression_requested": Optional[boolean], - "encrypted": Optional[boolean], - "journaled_data": Optional[boolean], - "indexed_directory": Optional[boolean], - "no_tailmerging": Optional[boolean], - "top_of_directory_hierarchies": Optional[boolean], - "extents": Optional[boolean], - "no_cow": Optional[boolean], - "casefold": Optional[boolean], - "inline_data": Optional[boolean], - "project_hierarchy": Optional[boolean], - "verity": Optional[boolean], - } - ] - -Examples: - - $ sudo lsattr /etc/passwd | jc --lsattr - [ - { - "file": "/etc/passwd", - "extents": true - } - ] -""" -from typing import List, Dict -from jc.jc_types import JSONDictType -import jc.utils - - -class info(): - """Provides parser metadata (version, author, etc.)""" - version = '1.0' - description = '`lsattr` command parser' - author = 'Mark Rotner' - author_email = 'rotner.mr@gmail.com' - compatible = ['linux'] - magic_commands = ['lsattr'] - tags = ['command'] - - -__version__ = info.version - - -ERROR_PREFIX = "lsattr:" - -# https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40 -# https://github.com/landley/toybox/blob/f1682dc79fd75f64042b5438918fe5a507977e1c/toys/other/lsattr.c#L97 -ATTRIBUTES = { - "B": "compressed_file", - "Z": "compressed_dirty_file", - "X": "compression_raw_access", - "s": "secure_deletion", - "u": "undelete", - "S": "synchronous_updates", - "D": "synchronous_directory_updates", - "i": "immutable", - "a": "append_only", - "d": "no_dump", - "A": "no_atime", - "c": "compression_requested", - "E": "encrypted", - "j": "journaled_data", - "I": "indexed_directory", - "t": "no_tailmerging", - "T": "top_of_directory_hierarchies", - "e": "extents", - "C": "no_cow", - "F": "casefold", - "N": "inline_data", - "P": "project_hierarchy", - "V": "verity", -} - - -def parse( - data: str, - raw: bool = False, - quiet: bool = False -) -> List[JSONDictType]: - """ - Main text parsing function - - Parameters: - - data: (string) text data to parse - quiet: (boolean) suppress warning messages if True - - Returns: - - List of Dictionaries. Raw or processed structured data. - """ - jc.utils.compatibility(__name__, info.compatible, quiet) - jc.utils.input_type_check(data) - - output: List = [] - - cleandata = list(filter(None, data.splitlines())) - - if not jc.utils.has_data(data): - return output - - for line in cleandata: - # -R flag returns the output in the format: - # Folder: - # attributes file_in_folder - if line.endswith(':'): - continue - - # lsattr: Operation not supported .... - if line.startswith(ERROR_PREFIX): - continue - - line_output: Dict = {} - - # attributes file - # --------------e----- /etc/passwd - attributes, file = line.split() - line_output['file'] = file - for attribute in list(attributes): - attribute_key = ATTRIBUTES.get(attribute) - if attribute_key: - line_output[attribute_key] = True - - if line_output: - output.append(line_output) - - return output +r"""jc - JSON Convert `lsattr` command output parser + +Usage (cli): + + $ lsattr | jc --lsattr + +or + + $ jc lsattr + +Usage (module): + + import jc + result = jc.parse('lsattr', lsattr_command_output) + +Schema: + +Information from https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40 +used to define field names + + [ + { + "file": string, + "compressed_file": Optional[boolean], + "compressed_dirty_file": Optional[boolean], + "compression_raw_access": Optional[boolean], + "secure_deletion": Optional[boolean], + "undelete": Optional[boolean], + "synchronous_updates": Optional[boolean], + "synchronous_directory_updates": Optional[boolean], + "immutable": Optional[boolean], + "append_only": Optional[boolean], + "no_dump": Optional[boolean], + "no_atime": Optional[boolean], + "compression_requested": Optional[boolean], + "encrypted": Optional[boolean], + "journaled_data": Optional[boolean], + "indexed_directory": Optional[boolean], + "no_tailmerging": Optional[boolean], + "top_of_directory_hierarchies": Optional[boolean], + "extents": Optional[boolean], + "no_cow": Optional[boolean], + "casefold": Optional[boolean], + "inline_data": Optional[boolean], + "project_hierarchy": Optional[boolean], + "verity": Optional[boolean], + } + ] + +Examples: + + $ sudo lsattr /etc/passwd | jc --lsattr + [ + { + "file": "/etc/passwd", + "extents": true + } + ] +""" +from typing import List, Dict +from jc.jc_types import JSONDictType +import jc.utils + + +class info(): + """Provides parser metadata (version, author, etc.)""" + version = '1.0' + description = '`lsattr` command parser' + author = 'Mark Rotner' + author_email = 'rotner.mr@gmail.com' + compatible = ['linux'] + magic_commands = ['lsattr'] + tags = ['command'] + + +__version__ = info.version + + +ERROR_PREFIX = "lsattr:" + +# https://github.com/mirror/busybox/blob/2d4a3d9e6c1493a9520b907e07a41aca90cdfd94/e2fsprogs/e2fs_lib.c#L40 +# https://github.com/landley/toybox/blob/f1682dc79fd75f64042b5438918fe5a507977e1c/toys/other/lsattr.c#L97 +ATTRIBUTES = { + "B": "compressed_file", + "Z": "compressed_dirty_file", + "X": "compression_raw_access", + "s": "secure_deletion", + "u": "undelete", + "S": "synchronous_updates", + "D": "synchronous_directory_updates", + "i": "immutable", + "a": "append_only", + "d": "no_dump", + "A": "no_atime", + "c": "compression_requested", + "E": "encrypted", + "j": "journaled_data", + "I": "indexed_directory", + "t": "no_tailmerging", + "T": "top_of_directory_hierarchies", + "e": "extents", + "C": "no_cow", + "F": "casefold", + "N": "inline_data", + "P": "project_hierarchy", + "V": "verity", +} + + +def parse( + data: str, + raw: bool = False, + quiet: bool = False +) -> List[JSONDictType]: + """ + Main text parsing function + + Parameters: + + data: (string) text data to parse + quiet: (boolean) suppress warning messages if True + + Returns: + + List of Dictionaries. Raw or processed structured data. + """ + jc.utils.compatibility(__name__, info.compatible, quiet) + jc.utils.input_type_check(data) + + output: List = [] + + cleandata = list(filter(None, data.splitlines())) + + if not jc.utils.has_data(data): + return output + + for line in cleandata: + # -R flag returns the output in the format: + # Folder: + # attributes file_in_folder + if line.endswith(':'): + continue + + # lsattr: Operation not supported .... + if line.startswith(ERROR_PREFIX): + continue + + line_output: Dict = {} + + # attributes file + # --------------e----- /etc/passwd + attributes, file = line.split() + line_output['file'] = file + for attribute in list(attributes): + attribute_key = ATTRIBUTES.get(attribute) + if attribute_key: + line_output[attribute_key] = True + + if line_output: + output.append(line_output) + + return output diff --git a/jc/parsers/lsb_release.py b/jc/parsers/lsb_release.py index 0d1d8e64..ed7540fa 100644 --- a/jc/parsers/lsb_release.py +++ b/jc/parsers/lsb_release.py @@ -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`). diff --git a/jc/parsers/lsmod.py b/jc/parsers/lsmod.py index b4b65d05..e794a8af 100644 --- a/jc/parsers/lsmod.py +++ b/jc/parsers/lsmod.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `lsmod` command output parser +r"""jc - JSON Convert `lsmod` command output parser Usage (cli): diff --git a/jc/parsers/lsof.py b/jc/parsers/lsof.py index 0fc434ae..03abbdc0 100644 --- a/jc/parsers/lsof.py +++ b/jc/parsers/lsof.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `lsof` command output parser +r"""jc - JSON Convert `lsof` command output parser Usage (cli): diff --git a/jc/parsers/lspci.py b/jc/parsers/lspci.py index 771fe38a..b47c38eb 100644 --- a/jc/parsers/lspci.py +++ b/jc/parsers/lspci.py @@ -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: - `-mmv` diff --git a/jc/parsers/lsusb.py b/jc/parsers/lsusb.py index 075c7fc0..86ec6953 100644 --- a/jc/parsers/lsusb.py +++ b/jc/parsers/lsusb.py @@ -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. diff --git a/jc/parsers/mdadm.py b/jc/parsers/mdadm.py index 852911ae..70744a30 100644 --- a/jc/parsers/mdadm.py +++ b/jc/parsers/mdadm.py @@ -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`. diff --git a/jc/parsers/mount.py b/jc/parsers/mount.py index 945ed81a..c2297130 100644 --- a/jc/parsers/mount.py +++ b/jc/parsers/mount.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `mount` command output parser +r"""jc - JSON Convert `mount` command output parser Usage (cli): diff --git a/jc/parsers/mpstat.py b/jc/parsers/mpstat.py index a89c940d..40184fc5 100644 --- a/jc/parsers/mpstat.py +++ b/jc/parsers/mpstat.py @@ -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+) diff --git a/jc/parsers/mpstat_s.py b/jc/parsers/mpstat_s.py index 3a746f2b..c35493a7 100644 --- a/jc/parsers/mpstat_s.py +++ b/jc/parsers/mpstat_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/needrestart.py b/jc/parsers/needrestart.py index c76983fd..c64f1cc2 100644 --- a/jc/parsers/needrestart.py +++ b/jc/parsers/needrestart.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `needrestart -b` command output parser +r"""jc - JSON Convert `needrestart -b` command output parser Usage (cli): diff --git a/jc/parsers/netstat.py b/jc/parsers/netstat.py index df715541..50c82b00 100644 --- a/jc/parsers/netstat.py +++ b/jc/parsers/netstat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `netstat` command output parser +r"""jc - JSON Convert `netstat` command output parser Caveats: - Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`) diff --git a/jc/parsers/netstat_freebsd_osx.py b/jc/parsers/netstat_freebsd_osx.py index eb610ea8..9eeb9e8d 100644 --- a/jc/parsers/netstat_freebsd_osx.py +++ b/jc/parsers/netstat_freebsd_osx.py @@ -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): diff --git a/jc/parsers/netstat_linux.py b/jc/parsers/netstat_linux.py index 322fcab8..222f2944 100644 --- a/jc/parsers/netstat_linux.py +++ b/jc/parsers/netstat_linux.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Linux netstat Parser""" +r"""jc - JSON Convert Linux netstat Parser""" import string diff --git a/jc/parsers/netstat_windows.py b/jc/parsers/netstat_windows.py index 835bc163..a14f57d8 100644 --- a/jc/parsers/netstat_windows.py +++ b/jc/parsers/netstat_windows.py @@ -1,4 +1,4 @@ -""" +r""" jc - JSON Convert Windows `netstat` command output parser """ diff --git a/jc/parsers/nmcli.py b/jc/parsers/nmcli.py index 25572eb9..4779725a 100644 --- a/jc/parsers/nmcli.py +++ b/jc/parsers/nmcli.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `nmcli` command output parser +r"""jc - JSON Convert `nmcli` command output parser Supports the following `nmcli` subcommands: - `nmcli general` diff --git a/jc/parsers/nsd_control.py b/jc/parsers/nsd_control.py index f4d16d47..fd80e950 100644 --- a/jc/parsers/nsd_control.py +++ b/jc/parsers/nsd_control.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `nsd-control` command output parser +r"""jc - JSON Convert `nsd-control` command output parser Usage (cli): diff --git a/jc/parsers/ntpq.py b/jc/parsers/ntpq.py index ab5740e9..fc75b65f 100644 --- a/jc/parsers/ntpq.py +++ b/jc/parsers/ntpq.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ntpq -p` command output parser +r"""jc - JSON Convert `ntpq -p` command output parser Usage (cli): diff --git a/jc/parsers/openvpn.py b/jc/parsers/openvpn.py index 2aa3f1ad..2917024f 100644 --- a/jc/parsers/openvpn.py +++ b/jc/parsers/openvpn.py @@ -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 local time of the system the parser is run on) diff --git a/jc/parsers/os_prober.py b/jc/parsers/os_prober.py index 94de1f5f..a97f15db 100644 --- a/jc/parsers/os_prober.py +++ b/jc/parsers/os_prober.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `os-prober` command output parser +r"""jc - JSON Convert `os-prober` command output parser Usage (cli): diff --git a/jc/parsers/passwd.py b/jc/parsers/passwd.py index 523e5d52..3ed40735 100644 --- a/jc/parsers/passwd.py +++ b/jc/parsers/passwd.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/passwd` file Parser +r"""jc - JSON Convert `/etc/passwd` file Parser Usage (cli): diff --git a/jc/parsers/path.py b/jc/parsers/path.py index 9596bb09..c556bd9f 100644 --- a/jc/parsers/path.py +++ b/jc/parsers/path.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert POSIX path string parser +r"""jc - JSON Convert POSIX path string parser Parse a POSIX path. diff --git a/jc/parsers/path_list.py b/jc/parsers/path_list.py index 7885d1b2..61763187 100644 --- a/jc/parsers/path_list.py +++ b/jc/parsers/path_list.py @@ -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 variables. diff --git a/jc/parsers/pci_ids.py b/jc/parsers/pci_ids.py index 2deb4031..7d7bbba3 100644 --- a/jc/parsers/pci_ids.py +++ b/jc/parsers/pci_ids.py @@ -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. diff --git a/jc/parsers/pgpass.py b/jc/parsers/pgpass.py index 409b2c2d..02b0134f 100644 --- a/jc/parsers/pgpass.py +++ b/jc/parsers/pgpass.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert PostgreSQL password file parser +r"""jc - JSON Convert PostgreSQL password file parser Usage (cli): diff --git a/jc/parsers/pidstat.py b/jc/parsers/pidstat.py index 29ac3aea..db480e3d 100644 --- a/jc/parsers/pidstat.py +++ b/jc/parsers/pidstat.py @@ -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`. All other `pidstat` options are supported in combination with this option. diff --git a/jc/parsers/pidstat_s.py b/jc/parsers/pidstat_s.py index c347a13a..3a4d6e3f 100644 --- a/jc/parsers/pidstat_s.py +++ b/jc/parsers/pidstat_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/ping.py b/jc/parsers/ping.py index 624e6739..6adf338b 100644 --- a/jc/parsers/ping.py +++ b/jc/parsers/ping.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ping` command output parser +r"""jc - JSON Convert `ping` command output parser Supports `ping` and `ping6` output. diff --git a/jc/parsers/ping_s.py b/jc/parsers/ping_s.py index 6cb7220f..8178f2d7 100644 --- a/jc/parsers/ping_s.py +++ b/jc/parsers/ping_s.py @@ -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 > Dictionaries (module) diff --git a/jc/parsers/pip_list.py b/jc/parsers/pip_list.py index 7bafeec2..2135936e 100644 --- a/jc/parsers/pip_list.py +++ b/jc/parsers/pip_list.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `pip-list` command output parser +r"""jc - JSON Convert `pip-list` command output parser Usage (cli): diff --git a/jc/parsers/pip_show.py b/jc/parsers/pip_show.py index 8d12ebd8..c3d9d9e8 100644 --- a/jc/parsers/pip_show.py +++ b/jc/parsers/pip_show.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `pip-show` command output parser +r"""jc - JSON Convert `pip-show` command output parser Usage (cli): diff --git a/jc/parsers/pkg_index_apk.py b/jc/parsers/pkg_index_apk.py index 3dd228dd..916a8ef5 100644 --- a/jc/parsers/pkg_index_apk.py +++ b/jc/parsers/pkg_index_apk.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Alpine Linux Package Index files +r"""jc - JSON Convert Alpine Linux Package Index files Usage (cli): diff --git a/jc/parsers/pkg_index_deb.py b/jc/parsers/pkg_index_deb.py index f5208f5f..5c9f1d28 100644 --- a/jc/parsers/pkg_index_deb.py +++ b/jc/parsers/pkg_index_deb.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Debian Package Index file parser +r"""jc - JSON Convert Debian Package Index file parser Usage (cli): diff --git a/jc/parsers/plist.py b/jc/parsers/plist.py index f7cd5514..e2c49eb9 100644 --- a/jc/parsers/plist.py +++ b/jc/parsers/plist.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert PLIST file parser +r"""jc - JSON Convert PLIST file parser Converts binary, XML, and NeXTSTEP PLIST files. diff --git a/jc/parsers/postconf.py b/jc/parsers/postconf.py index c4678fe0..ee83c660 100644 --- a/jc/parsers/postconf.py +++ b/jc/parsers/postconf.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `postconf -M` command output parser +r"""jc - JSON Convert `postconf -M` command output parser Usage (cli): diff --git a/jc/parsers/proc.py b/jc/parsers/proc.py index 39bfe029..92b667ae 100644 --- a/jc/parsers/proc.py +++ b/jc/parsers/proc.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Proc file output parser +r"""jc - JSON Convert Proc file output parser This parser automatically identifies the Proc file and calls the corresponding parser to perform the parsing. diff --git a/jc/parsers/proc_buddyinfo.py b/jc/parsers/proc_buddyinfo.py index 8262ca45..8bb22b3e 100644 --- a/jc/parsers/proc_buddyinfo.py +++ b/jc/parsers/proc_buddyinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/buddyinfo` file parser +r"""jc - JSON Convert `/proc/buddyinfo` file parser Usage (cli): diff --git a/jc/parsers/proc_cmdline.py b/jc/parsers/proc_cmdline.py index d4bf3d4f..287cac8b 100644 --- a/jc/parsers/proc_cmdline.py +++ b/jc/parsers/proc_cmdline.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/cmdline` file parser +r"""jc - JSON Convert `/proc/cmdline` file parser Usage (cli): diff --git a/jc/parsers/proc_consoles.py b/jc/parsers/proc_consoles.py index 3d8a95be..095f94d5 100644 --- a/jc/parsers/proc_consoles.py +++ b/jc/parsers/proc_consoles.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/consoles` file parser +r"""jc - JSON Convert `/proc/consoles` file parser Usage (cli): diff --git a/jc/parsers/proc_cpuinfo.py b/jc/parsers/proc_cpuinfo.py index e7628e65..4355941f 100644 --- a/jc/parsers/proc_cpuinfo.py +++ b/jc/parsers/proc_cpuinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/cpuinfo` file parser +r"""jc - JSON Convert `/proc/cpuinfo` file parser Usage (cli): diff --git a/jc/parsers/proc_crypto.py b/jc/parsers/proc_crypto.py index 76b270c5..7f392f35 100644 --- a/jc/parsers/proc_crypto.py +++ b/jc/parsers/proc_crypto.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/crypto` file parser +r"""jc - JSON Convert `/proc/crypto` file parser Usage (cli): diff --git a/jc/parsers/proc_devices.py b/jc/parsers/proc_devices.py index 20c2d1a5..63bf6a0d 100644 --- a/jc/parsers/proc_devices.py +++ b/jc/parsers/proc_devices.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/devices` file parser +r"""jc - JSON Convert `/proc/devices` file parser Usage (cli): diff --git a/jc/parsers/proc_diskstats.py b/jc/parsers/proc_diskstats.py index 1067f869..78686d33 100644 --- a/jc/parsers/proc_diskstats.py +++ b/jc/parsers/proc_diskstats.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/diskstats` file parser +r"""jc - JSON Convert `/proc/diskstats` file parser Usage (cli): diff --git a/jc/parsers/proc_driver_rtc.py b/jc/parsers/proc_driver_rtc.py index 8356755b..292649f3 100644 --- a/jc/parsers/proc_driver_rtc.py +++ b/jc/parsers/proc_driver_rtc.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/driver/rtc` file parser +r"""jc - JSON Convert `/proc/driver/rtc` file parser Usage (cli): diff --git a/jc/parsers/proc_filesystems.py b/jc/parsers/proc_filesystems.py index 2e079b98..2ed7b1d8 100644 --- a/jc/parsers/proc_filesystems.py +++ b/jc/parsers/proc_filesystems.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/filesystems` file parser +r"""jc - JSON Convert `/proc/filesystems` file parser Usage (cli): diff --git a/jc/parsers/proc_interrupts.py b/jc/parsers/proc_interrupts.py index 376c053e..acdd0615 100644 --- a/jc/parsers/proc_interrupts.py +++ b/jc/parsers/proc_interrupts.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/interrupts` file parser +r"""jc - JSON Convert `/proc/interrupts` file parser Usage (cli): diff --git a/jc/parsers/proc_iomem.py b/jc/parsers/proc_iomem.py index 9d4b2766..c0a18d1d 100644 --- a/jc/parsers/proc_iomem.py +++ b/jc/parsers/proc_iomem.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/iomem` file parser +r"""jc - JSON Convert `/proc/iomem` file parser Usage (cli): diff --git a/jc/parsers/proc_ioports.py b/jc/parsers/proc_ioports.py index bac1c563..128dbaa7 100644 --- a/jc/parsers/proc_ioports.py +++ b/jc/parsers/proc_ioports.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/ioports` file parser +r"""jc - JSON Convert `/proc/ioports` file parser Usage (cli): diff --git a/jc/parsers/proc_loadavg.py b/jc/parsers/proc_loadavg.py index 9247a41b..2ad3146f 100644 --- a/jc/parsers/proc_loadavg.py +++ b/jc/parsers/proc_loadavg.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/loadavg` file parser +r"""jc - JSON Convert `/proc/loadavg` file parser Usage (cli): diff --git a/jc/parsers/proc_locks.py b/jc/parsers/proc_locks.py index 01e8a3ca..8c9e95e5 100644 --- a/jc/parsers/proc_locks.py +++ b/jc/parsers/proc_locks.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/locks` file parser +r"""jc - JSON Convert `/proc/locks` file parser Usage (cli): diff --git a/jc/parsers/proc_meminfo.py b/jc/parsers/proc_meminfo.py index d8ddce64..6181747c 100644 --- a/jc/parsers/proc_meminfo.py +++ b/jc/parsers/proc_meminfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/meminfo` file parser +r"""jc - JSON Convert `/proc/meminfo` file parser Usage (cli): diff --git a/jc/parsers/proc_modules.py b/jc/parsers/proc_modules.py index 472c389a..17c4ad3a 100644 --- a/jc/parsers/proc_modules.py +++ b/jc/parsers/proc_modules.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/modules` file parser +r"""jc - JSON Convert `/proc/modules` file parser Usage (cli): diff --git a/jc/parsers/proc_mtrr.py b/jc/parsers/proc_mtrr.py index fbeae40b..29195a54 100644 --- a/jc/parsers/proc_mtrr.py +++ b/jc/parsers/proc_mtrr.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/mtrr` file parser +r"""jc - JSON Convert `/proc/mtrr` file parser Usage (cli): diff --git a/jc/parsers/proc_net_arp.py b/jc/parsers/proc_net_arp.py index 47dfa623..1ae44733 100644 --- a/jc/parsers/proc_net_arp.py +++ b/jc/parsers/proc_net_arp.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/arp` file parser +r"""jc - JSON Convert `/proc/net/arp` file parser Usage (cli): diff --git a/jc/parsers/proc_net_dev.py b/jc/parsers/proc_net_dev.py index 14cf4af6..9c584fbf 100644 --- a/jc/parsers/proc_net_dev.py +++ b/jc/parsers/proc_net_dev.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/dev` file parser +r"""jc - JSON Convert `/proc/net/dev` file parser Usage (cli): diff --git a/jc/parsers/proc_net_dev_mcast.py b/jc/parsers/proc_net_dev_mcast.py index 3984f341..e585e6d2 100644 --- a/jc/parsers/proc_net_dev_mcast.py +++ b/jc/parsers/proc_net_dev_mcast.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/dev_mcast` file parser +r"""jc - JSON Convert `/proc/net/dev_mcast` file parser Usage (cli): diff --git a/jc/parsers/proc_net_if_inet6.py b/jc/parsers/proc_net_if_inet6.py index a2e3d11e..ea5d1b5a 100644 --- a/jc/parsers/proc_net_if_inet6.py +++ b/jc/parsers/proc_net_if_inet6.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/if_inet6` file parser +r"""jc - JSON Convert `/proc/net/if_inet6` file parser Usage (cli): diff --git a/jc/parsers/proc_net_igmp.py b/jc/parsers/proc_net_igmp.py index d4f26b7d..ff1b7aa8 100644 --- a/jc/parsers/proc_net_igmp.py +++ b/jc/parsers/proc_net_igmp.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/igmp` file parser +r"""jc - JSON Convert `/proc/net/igmp` file parser Usage (cli): diff --git a/jc/parsers/proc_net_igmp6.py b/jc/parsers/proc_net_igmp6.py index a1640959..594042f0 100644 --- a/jc/parsers/proc_net_igmp6.py +++ b/jc/parsers/proc_net_igmp6.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/igmp6` file parser +r"""jc - JSON Convert `/proc/net/igmp6` file parser Usage (cli): diff --git a/jc/parsers/proc_net_ipv6_route.py b/jc/parsers/proc_net_ipv6_route.py index b9643a8f..123ae176 100644 --- a/jc/parsers/proc_net_ipv6_route.py +++ b/jc/parsers/proc_net_ipv6_route.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/ipv6_route` file parser +r"""jc - JSON Convert `/proc/net/ipv6_route` file parser Usage (cli): diff --git a/jc/parsers/proc_net_netlink.py b/jc/parsers/proc_net_netlink.py index 31a8deb6..037af0b1 100644 --- a/jc/parsers/proc_net_netlink.py +++ b/jc/parsers/proc_net_netlink.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/netlink` file parser +r"""jc - JSON Convert `/proc/net/netlink` file parser Usage (cli): diff --git a/jc/parsers/proc_net_netstat.py b/jc/parsers/proc_net_netstat.py index d7ae90a7..7d769227 100644 --- a/jc/parsers/proc_net_netstat.py +++ b/jc/parsers/proc_net_netstat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/netstat` file parser +r"""jc - JSON Convert `/proc/net/netstat` file parser Usage (cli): diff --git a/jc/parsers/proc_net_packet.py b/jc/parsers/proc_net_packet.py index c2945171..fdff3b3e 100644 --- a/jc/parsers/proc_net_packet.py +++ b/jc/parsers/proc_net_packet.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/packet` file parser +r"""jc - JSON Convert `/proc/net/packet` file parser Usage (cli): diff --git a/jc/parsers/proc_net_protocols.py b/jc/parsers/proc_net_protocols.py index 11a136dd..b04fd47f 100644 --- a/jc/parsers/proc_net_protocols.py +++ b/jc/parsers/proc_net_protocols.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/protocols` file parser +r"""jc - JSON Convert `/proc/net/protocols` file parser Usage (cli): diff --git a/jc/parsers/proc_net_route.py b/jc/parsers/proc_net_route.py index ff7e41d7..ffac2bb8 100644 --- a/jc/parsers/proc_net_route.py +++ b/jc/parsers/proc_net_route.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/route` file parser +r"""jc - JSON Convert `/proc/net/route` file parser Usage (cli): diff --git a/jc/parsers/proc_net_tcp.py b/jc/parsers/proc_net_tcp.py index 6b504f7e..4f687e26 100644 --- a/jc/parsers/proc_net_tcp.py +++ b/jc/parsers/proc_net_tcp.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/tcp` and `proc/net/tcp6` file parser +r"""jc - JSON Convert `/proc/net/tcp` and `proc/net/tcp6` file parser IPv4 and IPv6 addresses are converted to standard notation unless the raw (--raw) option is used. diff --git a/jc/parsers/proc_net_unix.py b/jc/parsers/proc_net_unix.py index db1f5338..dc51afd5 100644 --- a/jc/parsers/proc_net_unix.py +++ b/jc/parsers/proc_net_unix.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/net/unix` file parser +r"""jc - JSON Convert `/proc/net/unix` file parser Usage (cli): diff --git a/jc/parsers/proc_pagetypeinfo.py b/jc/parsers/proc_pagetypeinfo.py index 92a0ed26..f14458e9 100644 --- a/jc/parsers/proc_pagetypeinfo.py +++ b/jc/parsers/proc_pagetypeinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/pagetypeinfo` file parser +r"""jc - JSON Convert `/proc/pagetypeinfo` file parser Usage (cli): diff --git a/jc/parsers/proc_partitions.py b/jc/parsers/proc_partitions.py index 6afbeda0..494acff9 100644 --- a/jc/parsers/proc_partitions.py +++ b/jc/parsers/proc_partitions.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/partitions` file parser +r"""jc - JSON Convert `/proc/partitions` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_fdinfo.py b/jc/parsers/proc_pid_fdinfo.py index d86d6ec3..48cbfeae 100644 --- a/jc/parsers/proc_pid_fdinfo.py +++ b/jc/parsers/proc_pid_fdinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//fdinfo/` file parser +r"""jc - JSON Convert `/proc//fdinfo/` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_io.py b/jc/parsers/proc_pid_io.py index c450302d..a2fda8a8 100644 --- a/jc/parsers/proc_pid_io.py +++ b/jc/parsers/proc_pid_io.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//io` file parser +r"""jc - JSON Convert `/proc//io` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_maps.py b/jc/parsers/proc_pid_maps.py index e51c0fed..28ca6567 100644 --- a/jc/parsers/proc_pid_maps.py +++ b/jc/parsers/proc_pid_maps.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//maps` file parser +r"""jc - JSON Convert `/proc//maps` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_mountinfo.py b/jc/parsers/proc_pid_mountinfo.py index 5b43bc94..3d55fb1d 100644 --- a/jc/parsers/proc_pid_mountinfo.py +++ b/jc/parsers/proc_pid_mountinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//mountinfo` file parser +r"""jc - JSON Convert `/proc//mountinfo` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_numa_maps.py b/jc/parsers/proc_pid_numa_maps.py index 2210d401..a9ebc3d4 100644 --- a/jc/parsers/proc_pid_numa_maps.py +++ b/jc/parsers/proc_pid_numa_maps.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//numa_maps` file parser +r"""jc - JSON Convert `/proc//numa_maps` file parser This parser will attempt to convert number values to integers. If that is not desired, please use the `--raw` option (cli) or `raw=True` argument diff --git a/jc/parsers/proc_pid_smaps.py b/jc/parsers/proc_pid_smaps.py index e20c3882..d7be98fc 100644 --- a/jc/parsers/proc_pid_smaps.py +++ b/jc/parsers/proc_pid_smaps.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//smaps` file parser +r"""jc - JSON Convert `/proc//smaps` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_stat.py b/jc/parsers/proc_pid_stat.py index 76e489e2..4e83a707 100644 --- a/jc/parsers/proc_pid_stat.py +++ b/jc/parsers/proc_pid_stat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//stat` file parser +r"""jc - JSON Convert `/proc//stat` file parser Usage (cli): diff --git a/jc/parsers/proc_pid_statm.py b/jc/parsers/proc_pid_statm.py index a1cd2f42..eae5b5ea 100644 --- a/jc/parsers/proc_pid_statm.py +++ b/jc/parsers/proc_pid_statm.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc//statm` file parser +r"""jc - JSON Convert `/proc//statm` file parser Usage (cli): diff --git a/jc/parsers/proc_slabinfo.py b/jc/parsers/proc_slabinfo.py index 15488281..630e31bd 100644 --- a/jc/parsers/proc_slabinfo.py +++ b/jc/parsers/proc_slabinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/slabinfo` file parser +r"""jc - JSON Convert `/proc/slabinfo` file parser Usage (cli): diff --git a/jc/parsers/proc_softirqs.py b/jc/parsers/proc_softirqs.py index cac25ae9..cd5c7ad1 100644 --- a/jc/parsers/proc_softirqs.py +++ b/jc/parsers/proc_softirqs.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/softirqs` file parser +r"""jc - JSON Convert `/proc/softirqs` file parser Usage (cli): diff --git a/jc/parsers/proc_stat.py b/jc/parsers/proc_stat.py index a09f67e9..f25f5a0f 100644 --- a/jc/parsers/proc_stat.py +++ b/jc/parsers/proc_stat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/stat` file parser +r"""jc - JSON Convert `/proc/stat` file parser Usage (cli): diff --git a/jc/parsers/proc_swaps.py b/jc/parsers/proc_swaps.py index 97269f4b..b1a3f94b 100644 --- a/jc/parsers/proc_swaps.py +++ b/jc/parsers/proc_swaps.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/swaps` file parser +r"""jc - JSON Convert `/proc/swaps` file parser Usage (cli): diff --git a/jc/parsers/proc_uptime.py b/jc/parsers/proc_uptime.py index c3207e47..a00ea498 100644 --- a/jc/parsers/proc_uptime.py +++ b/jc/parsers/proc_uptime.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/uptime` file parser +r"""jc - JSON Convert `/proc/uptime` file parser Usage (cli): diff --git a/jc/parsers/proc_version.py b/jc/parsers/proc_version.py index e0fc4626..8d0c59c3 100644 --- a/jc/parsers/proc_version.py +++ b/jc/parsers/proc_version.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/version` file parser +r"""jc - JSON Convert `/proc/version` file parser > Note: This parser will parse `/proc/version` files that follow the > common format used by most popular linux distributions. diff --git a/jc/parsers/proc_vmallocinfo.py b/jc/parsers/proc_vmallocinfo.py index 4001830e..35545e21 100644 --- a/jc/parsers/proc_vmallocinfo.py +++ b/jc/parsers/proc_vmallocinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/vmallocinfo` file parser +r"""jc - JSON Convert `/proc/vmallocinfo` file parser This parser will attempt to convert number values to integers. If that is not desired, please use the `--raw` option (cli) or `raw=True` argument diff --git a/jc/parsers/proc_vmstat.py b/jc/parsers/proc_vmstat.py index 522f04ba..8298af6e 100644 --- a/jc/parsers/proc_vmstat.py +++ b/jc/parsers/proc_vmstat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/vmstat` file parser +r"""jc - JSON Convert `/proc/vmstat` file parser Usage (cli): diff --git a/jc/parsers/proc_zoneinfo.py b/jc/parsers/proc_zoneinfo.py index 77688b3b..cfc30b07 100644 --- a/jc/parsers/proc_zoneinfo.py +++ b/jc/parsers/proc_zoneinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/proc/zoneinfo` file parser +r"""jc - JSON Convert `/proc/zoneinfo` file parser Usage (cli): diff --git a/jc/parsers/ps.py b/jc/parsers/ps.py index 11ef2f90..493fc015 100644 --- a/jc/parsers/ps.py +++ b/jc/parsers/ps.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ps` command output parser +r"""jc - JSON Convert `ps` command output parser `ps` options supported: - `ef` diff --git a/jc/parsers/resolve_conf.py b/jc/parsers/resolve_conf.py index 82f22129..5de046e2 100644 --- a/jc/parsers/resolve_conf.py +++ b/jc/parsers/resolve_conf.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/resolve.conf` file parser +r"""jc - JSON Convert `/etc/resolve.conf` file parser This parser may be more forgiving than the system parser. For example, if multiple `search` lists are defined, this parser will append all entries to diff --git a/jc/parsers/route.py b/jc/parsers/route.py index d6ae5a42..17b7eff6 100644 --- a/jc/parsers/route.py +++ b/jc/parsers/route.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `route` command output parser +r"""jc - JSON Convert `route` command output parser Usage (cli): diff --git a/jc/parsers/route_windows.py b/jc/parsers/route_windows.py index 46a8cbf7..a653f03b 100644 --- a/jc/parsers/route_windows.py +++ b/jc/parsers/route_windows.py @@ -1,4 +1,4 @@ -""" +r""" jc - JSON Convert Windows `route` command output parser """ diff --git a/jc/parsers/rpm_qi.py b/jc/parsers/rpm_qi.py index 046ad003..e48fb731 100644 --- a/jc/parsers/rpm_qi.py +++ b/jc/parsers/rpm_qi.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `rpm -qi` command output parser +r"""jc - JSON Convert `rpm -qi` command output parser Works with `rpm -qi [package]` or `rpm -qia`. diff --git a/jc/parsers/rsync.py b/jc/parsers/rsync.py index 0a3fdede..195aae77 100644 --- a/jc/parsers/rsync.py +++ b/jc/parsers/rsync.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `rsync` command output parser +r"""jc - JSON Convert `rsync` command output parser Supports the `-i` or `--itemize-changes` options with all levels of verbosity. This parser will process the `STDOUT` output or a log file diff --git a/jc/parsers/rsync_s.py b/jc/parsers/rsync_s.py index f48c9888..4e80c4ef 100644 --- a/jc/parsers/rsync_s.py +++ b/jc/parsers/rsync_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `rsync` command output streaming parser +r"""jc - JSON Convert `rsync` command output streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/semver.py b/jc/parsers/semver.py index 08e2f30e..eca78de8 100644 --- a/jc/parsers/semver.py +++ b/jc/parsers/semver.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Semantic Version string parser +r"""jc - JSON Convert Semantic Version string parser This parser conforms to the specification at https://semver.org/ diff --git a/jc/parsers/sfdisk.py b/jc/parsers/sfdisk.py index 365414c5..50de56dc 100644 --- a/jc/parsers/sfdisk.py +++ b/jc/parsers/sfdisk.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `sfdisk` command output parser +r"""jc - JSON Convert `sfdisk` command output parser Supports the following `sfdisk` options: - `-l` diff --git a/jc/parsers/shadow.py b/jc/parsers/shadow.py index 6b5c8dc4..def7fc74 100644 --- a/jc/parsers/shadow.py +++ b/jc/parsers/shadow.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `/etc/shadow` file parser +r"""jc - JSON Convert `/etc/shadow` file parser Usage (cli): diff --git a/jc/parsers/srt.py b/jc/parsers/srt.py index 55564ed0..08e278c8 100644 --- a/jc/parsers/srt.py +++ b/jc/parsers/srt.py @@ -1,281 +1,281 @@ -r"""jc - JSON Convert `SRT` file parser - -Usage (cli): - - $ cat foo.srt | jc --srt - -Usage (module): - - import jc - result = jc.parse('srt', srt_file_output) - -Schema: - - [ - { - "index": int, - "start": { - "hours": int, - "minutes": int, - "seconds": int, - "milliseconds": int, - "timestamp": string - }, - "end": { - "hours": int, - "minutes": int, - "seconds": int, - "milliseconds": int, - "timestamp": string - }, - "content": string - } - ] - -Examples: - - $ cat attack_of_the_clones.srt - 1 - 00:02:16,612 --> 00:02:19,376 - Senator, we're making - our final approach into Coruscant. - - 2 - 00:02:19,482 --> 00:02:21,609 - Very good, Lieutenant. - ... - - $ cat attack_of_the_clones.srt | jc --srt - [ - { - "index": 1, - "start": { - "hours": 0, - "minutes": 2, - "seconds": 16, - "milliseconds": 612, - "timestamp": "00:02:16,612" - }, - "end": { - "hours": 0, - "minutes": 2, - "seconds": 19, - "milliseconds": 376, - "timestamp": "00:02:19,376" - }, - "content": "Senator, we're making\nour final approach into Coruscant." - }, - { - "index": 2, - "start": { - "hours": 0, - "minutes": 2, - "seconds": 19, - "milliseconds": 482, - "timestamp": "00:02:19,482" - }, - "end": { - "hours": 0, - "minutes": 2, - "seconds": 21, - "milliseconds": 609, - "timestamp": "00:02:21,609" - }, - "content": "Very good, Lieutenant." - }, - ... - ] -""" -import jc.utils -import re -from typing import List, Dict -from jc.jc_types import JSONDictType - - -class info(): - """Provides parser metadata (version, author, etc.)""" - version = '1.0' - description = 'SRT file parser' - author = 'Mark Rotner' - author_email = 'rotner.mr@gmail.com' - compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] - tags = ['standard', 'file', 'string'] - - -__version__ = info.version - -# Regex from https://github.com/cdown/srt/blob/434d0c1c9d5c26d5c3fb1ce979fc05b478e9253c/srt.py#LL16C1. - -# The MIT License - -# Copyright (c) 2014-present Christopher Down - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# The format: (int)index\n(timestamp)start --> (timestamp)end\n(str)content\n. -# Example: -# 1 -# 00:02:16,612 --> 00:02:19,376 -# Senator, we're making our final approach into Coruscant. - -# Start & End timestamp format: hours:minutes:seconds,millisecond. -# "." is not technically valid as a delimiter, but many editors create SRT -# files with this delimiter for whatever reason. Many editors and players -# accept it, so we do too. -RGX_TIMESTAMP_MAGNITUDE_DELIM = r"[,.:,.。:]" -RGX_POSITIVE_INT = r"[0-9]+" -RGX_POSITIVE_INT_OPTIONAL = r"[0-9]*" -RGX_TIMESTAMP = '{field}{separator}{field}{separator}{field}{separator}?{optional_field}'.format( - separator=RGX_TIMESTAMP_MAGNITUDE_DELIM, - field=RGX_POSITIVE_INT, - optional_field=RGX_POSITIVE_INT_OPTIONAL -) -RGX_INDEX = r"-?[0-9]+\.?[0-9]*" # int\float\negative. -RGX_CONTENT = r".*?" # Anything(except newline) but lazy. -RGX_NEWLINE = r"\r?\n" # Newline(CRLF\LF). -SRT_REGEX = re.compile( - r"\s*(?:({index})\s*{newline})?({ts}) *-[ -] *> *({ts}) ?(?:{newline}|\Z)({content})" - # Many sub editors don't add a blank line to the end, and many editors and - # players accept that. We allow it to be missing in input. - # - # We also allow subs that are missing a double blank newline. This often - # happens on subs which were first created as a mixed language subtitle, - # for example chs/eng, and then were stripped using naive methods (such as - # ed/sed) that don't understand newline preservation rules in SRT files. - # - # This means that when you are, say, only keeping chs, and the line only - # contains english, you end up with not only no content, but also all of - # the content lines are stripped instead of retaining a newline. - r"(?:{newline}|\Z)(?:{newline}|\Z|(?=(?:{index}\s*{newline}{ts})))" - # Some SRT blocks, while this is technically invalid, have blank lines - # inside the subtitle content. We look ahead a little to check that the - # next lines look like an index and a timestamp as a best-effort - # solution to work around these. - r"(?=(?:(?:{index}\s*{newline})?{ts}|\Z))".format( - index=RGX_INDEX, - ts=RGX_TIMESTAMP, - content=RGX_CONTENT, - newline=RGX_NEWLINE, - ), - re.DOTALL, -) -TIMESTAMP_REGEX = re.compile( - '^({field}){separator}({field}){separator}({field}){separator}?({optional_field})$'.format( - separator=RGX_TIMESTAMP_MAGNITUDE_DELIM, - field=RGX_POSITIVE_INT, - optional_field=RGX_POSITIVE_INT_OPTIONAL - ) -) - - -def _process(proc_data: List[JSONDictType]) -> List[JSONDictType]: - """ - Final processing to conform to the schema. - - Parameters: - - proc_data: (Dictionary) raw structured data to process - - Returns: - - List of Dictionaries representing an SRT document. - """ - - int_list = {'index'} - timestamp_list = {"start", "end"} - timestamp_int_list = {"hours", "minutes", "seconds", "milliseconds"} - - for entry in proc_data: - # Converting {"index"} to int. - for key in entry: - if key in int_list: - entry[key] = jc.utils.convert_to_int(entry[key]) - - # Converting {"hours", "minutes", "seconds", "milliseconds"} to int. - if key in timestamp_list: - timestamp = entry[key] - for timestamp_key in timestamp: - if timestamp_key in timestamp_int_list: - timestamp[timestamp_key] = jc.utils.convert_to_int( - timestamp[timestamp_key]) - - return proc_data - - -def parse_timestamp(timestamp: str) -> Dict: - """ - timestamp: "hours:minutes:seconds,milliseconds" ---> - { - "hours": "hours", - "minutes": "minutes", - "seconds": "seconds", - "milliseconds": "milliseconds", - "timestamp": "hours:minutes:seconds,milliseconds" - } - """ - ts_match = TIMESTAMP_REGEX.match(timestamp) - if ts_match: - hours, minutes, seconds, milliseconds = ts_match.groups() - return { - "hours": hours, - "minutes": minutes, - "seconds": seconds, - "milliseconds": milliseconds, - "timestamp": timestamp - } - return {} - - -def parse( - data: str, - raw: bool = False, - quiet: bool = False -) -> List[JSONDictType]: - """ - Main text parsing function - - Parameters: - - data: (string) text data to parse - raw: (boolean) unprocessed output if True - quiet: (boolean) suppress warning messages if True - - Returns: - - Dictionary. Raw or processed structured data. - """ - jc.utils.compatibility(__name__, info.compatible, quiet) - jc.utils.input_type_check(data) - - raw_output: List[Dict] = [] - if not jc.utils.has_data(data): - return raw_output - - for subtitle in SRT_REGEX.finditer(data): - index, start, end, content = subtitle.groups() - raw_output.append( - { - "index": index, - "start": parse_timestamp(start), - "end": parse_timestamp(end), - "content": content.replace("\r\n", "\n") - } - ) - - return raw_output if raw else _process(raw_output) +r"""jc - JSON Convert `SRT` file parser + +Usage (cli): + + $ cat foo.srt | jc --srt + +Usage (module): + + import jc + result = jc.parse('srt', srt_file_output) + +Schema: + + [ + { + "index": int, + "start": { + "hours": int, + "minutes": int, + "seconds": int, + "milliseconds": int, + "timestamp": string + }, + "end": { + "hours": int, + "minutes": int, + "seconds": int, + "milliseconds": int, + "timestamp": string + }, + "content": string + } + ] + +Examples: + + $ cat attack_of_the_clones.srt + 1 + 00:02:16,612 --> 00:02:19,376 + Senator, we're making + our final approach into Coruscant. + + 2 + 00:02:19,482 --> 00:02:21,609 + Very good, Lieutenant. + ... + + $ cat attack_of_the_clones.srt | jc --srt + [ + { + "index": 1, + "start": { + "hours": 0, + "minutes": 2, + "seconds": 16, + "milliseconds": 612, + "timestamp": "00:02:16,612" + }, + "end": { + "hours": 0, + "minutes": 2, + "seconds": 19, + "milliseconds": 376, + "timestamp": "00:02:19,376" + }, + "content": "Senator, we're making\nour final approach into Coruscant." + }, + { + "index": 2, + "start": { + "hours": 0, + "minutes": 2, + "seconds": 19, + "milliseconds": 482, + "timestamp": "00:02:19,482" + }, + "end": { + "hours": 0, + "minutes": 2, + "seconds": 21, + "milliseconds": 609, + "timestamp": "00:02:21,609" + }, + "content": "Very good, Lieutenant." + }, + ... + ] +""" +import jc.utils +import re +from typing import List, Dict +from jc.jc_types import JSONDictType + + +class info(): + """Provides parser metadata (version, author, etc.)""" + version = '1.0' + description = 'SRT file parser' + author = 'Mark Rotner' + author_email = 'rotner.mr@gmail.com' + compatible = ['linux', 'darwin', 'cygwin', 'win32', 'aix', 'freebsd'] + tags = ['standard', 'file', 'string'] + + +__version__ = info.version + +# Regex from https://github.com/cdown/srt/blob/434d0c1c9d5c26d5c3fb1ce979fc05b478e9253c/srt.py#LL16C1. + +# The MIT License + +# Copyright (c) 2014-present Christopher Down + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + +# The format: (int)index\n(timestamp)start --> (timestamp)end\n(str)content\n. +# Example: +# 1 +# 00:02:16,612 --> 00:02:19,376 +# Senator, we're making our final approach into Coruscant. + +# Start & End timestamp format: hours:minutes:seconds,millisecond. +# "." is not technically valid as a delimiter, but many editors create SRT +# files with this delimiter for whatever reason. Many editors and players +# accept it, so we do too. +RGX_TIMESTAMP_MAGNITUDE_DELIM = r"[,.:,.。:]" +RGX_POSITIVE_INT = r"[0-9]+" +RGX_POSITIVE_INT_OPTIONAL = r"[0-9]*" +RGX_TIMESTAMP = '{field}{separator}{field}{separator}{field}{separator}?{optional_field}'.format( + separator=RGX_TIMESTAMP_MAGNITUDE_DELIM, + field=RGX_POSITIVE_INT, + optional_field=RGX_POSITIVE_INT_OPTIONAL +) +RGX_INDEX = r"-?[0-9]+\.?[0-9]*" # int\float\negative. +RGX_CONTENT = r".*?" # Anything(except newline) but lazy. +RGX_NEWLINE = r"\r?\n" # Newline(CRLF\LF). +SRT_REGEX = re.compile( + r"\s*(?:({index})\s*{newline})?({ts}) *-[ -] *> *({ts}) ?(?:{newline}|\Z)({content})" + # Many sub editors don't add a blank line to the end, and many editors and + # players accept that. We allow it to be missing in input. + # + # We also allow subs that are missing a double blank newline. This often + # happens on subs which were first created as a mixed language subtitle, + # for example chs/eng, and then were stripped using naive methods (such as + # ed/sed) that don't understand newline preservation rules in SRT files. + # + # This means that when you are, say, only keeping chs, and the line only + # contains english, you end up with not only no content, but also all of + # the content lines are stripped instead of retaining a newline. + r"(?:{newline}|\Z)(?:{newline}|\Z|(?=(?:{index}\s*{newline}{ts})))" + # Some SRT blocks, while this is technically invalid, have blank lines + # inside the subtitle content. We look ahead a little to check that the + # next lines look like an index and a timestamp as a best-effort + # solution to work around these. + r"(?=(?:(?:{index}\s*{newline})?{ts}|\Z))".format( + index=RGX_INDEX, + ts=RGX_TIMESTAMP, + content=RGX_CONTENT, + newline=RGX_NEWLINE, + ), + re.DOTALL, +) +TIMESTAMP_REGEX = re.compile( + '^({field}){separator}({field}){separator}({field}){separator}?({optional_field})$'.format( + separator=RGX_TIMESTAMP_MAGNITUDE_DELIM, + field=RGX_POSITIVE_INT, + optional_field=RGX_POSITIVE_INT_OPTIONAL + ) +) + + +def _process(proc_data: List[JSONDictType]) -> List[JSONDictType]: + """ + Final processing to conform to the schema. + + Parameters: + + proc_data: (Dictionary) raw structured data to process + + Returns: + + List of Dictionaries representing an SRT document. + """ + + int_list = {'index'} + timestamp_list = {"start", "end"} + timestamp_int_list = {"hours", "minutes", "seconds", "milliseconds"} + + for entry in proc_data: + # Converting {"index"} to int. + for key in entry: + if key in int_list: + entry[key] = jc.utils.convert_to_int(entry[key]) + + # Converting {"hours", "minutes", "seconds", "milliseconds"} to int. + if key in timestamp_list: + timestamp = entry[key] + for timestamp_key in timestamp: + if timestamp_key in timestamp_int_list: + timestamp[timestamp_key] = jc.utils.convert_to_int( + timestamp[timestamp_key]) + + return proc_data + + +def parse_timestamp(timestamp: str) -> Dict: + """ + timestamp: "hours:minutes:seconds,milliseconds" ---> + { + "hours": "hours", + "minutes": "minutes", + "seconds": "seconds", + "milliseconds": "milliseconds", + "timestamp": "hours:minutes:seconds,milliseconds" + } + """ + ts_match = TIMESTAMP_REGEX.match(timestamp) + if ts_match: + hours, minutes, seconds, milliseconds = ts_match.groups() + return { + "hours": hours, + "minutes": minutes, + "seconds": seconds, + "milliseconds": milliseconds, + "timestamp": timestamp + } + return {} + + +def parse( + data: str, + raw: bool = False, + quiet: bool = False +) -> List[JSONDictType]: + """ + Main text parsing function + + Parameters: + + data: (string) text data to parse + raw: (boolean) unprocessed output if True + quiet: (boolean) suppress warning messages if True + + Returns: + + Dictionary. Raw or processed structured data. + """ + jc.utils.compatibility(__name__, info.compatible, quiet) + jc.utils.input_type_check(data) + + raw_output: List[Dict] = [] + if not jc.utils.has_data(data): + return raw_output + + for subtitle in SRT_REGEX.finditer(data): + index, start, end, content = subtitle.groups() + raw_output.append( + { + "index": index, + "start": parse_timestamp(start), + "end": parse_timestamp(end), + "content": content.replace("\r\n", "\n") + } + ) + + return raw_output if raw else _process(raw_output) diff --git a/jc/parsers/ss.py b/jc/parsers/ss.py index 20f7cb6b..502953fa 100644 --- a/jc/parsers/ss.py +++ b/jc/parsers/ss.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ss` command output parser +r"""jc - JSON Convert `ss` command output parser Usage (cli): diff --git a/jc/parsers/ssh_conf.py b/jc/parsers/ssh_conf.py index 95b2c7ec..771d93ef 100644 --- a/jc/parsers/ssh_conf.py +++ b/jc/parsers/ssh_conf.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ssh` configuration file and `ssh -G` command output parser +r"""jc - JSON Convert `ssh` configuration file and `ssh -G` command output parser This parser will work with `ssh` configuration files or the output of `ssh -G`. Any `Match` blocks in the `ssh` configuration file will be diff --git a/jc/parsers/sshd_conf.py b/jc/parsers/sshd_conf.py index a295e237..9b57e0e5 100644 --- a/jc/parsers/sshd_conf.py +++ b/jc/parsers/sshd_conf.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `sshd` configuration file and `sshd -T` command output parser +r"""jc - JSON Convert `sshd` configuration file and `sshd -T` command output parser This parser will work with `sshd` configuration files or the output of `sshd -T`. Any `Match` blocks in the `sshd` configuration file will be diff --git a/jc/parsers/stat.py b/jc/parsers/stat.py index 00040e04..20e9d585 100644 --- a/jc/parsers/stat.py +++ b/jc/parsers/stat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `stat` command output parser +r"""jc - JSON Convert `stat` command output parser The `xxx_epoch` calculated timestamp fields are naive. (i.e. based on the local time of the system the parser is run on) diff --git a/jc/parsers/stat_s.py b/jc/parsers/stat_s.py index c3e1a0b4..b55c0db1 100644 --- a/jc/parsers/stat_s.py +++ b/jc/parsers/stat_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `stat` command output streaming parser +r"""jc - JSON Convert `stat` command output streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/swapon.py b/jc/parsers/swapon.py index 180be925..8c4aabd1 100644 --- a/jc/parsers/swapon.py +++ b/jc/parsers/swapon.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `swapon` command output parser +r"""jc - JSON Convert `swapon` command output parser Usage (cli): diff --git a/jc/parsers/sysctl.py b/jc/parsers/sysctl.py index e1bbe56e..195679c4 100644 --- a/jc/parsers/sysctl.py +++ b/jc/parsers/sysctl.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `sysctl -a` command output parser +r"""jc - JSON Convert `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 diff --git a/jc/parsers/syslog_bsd.py b/jc/parsers/syslog_bsd.py index 87ce7236..3040a247 100644 --- a/jc/parsers/syslog_bsd.py +++ b/jc/parsers/syslog_bsd.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Syslog RFC 3164 string parser +r"""jc - JSON Convert Syslog RFC 3164 string parser This parser accepts a single syslog line string or multiple syslog lines separated by newlines. A warning message to `STDERR` will be printed if an diff --git a/jc/parsers/syslog_bsd_s.py b/jc/parsers/syslog_bsd_s.py index a4b05c0c..ebbad402 100644 --- a/jc/parsers/syslog_bsd_s.py +++ b/jc/parsers/syslog_bsd_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Syslog RFC 3164 string streaming parser +r"""jc - JSON Convert Syslog RFC 3164 string streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/syslog_s.py b/jc/parsers/syslog_s.py index 871f27cf..e708b5e0 100644 --- a/jc/parsers/syslog_s.py +++ b/jc/parsers/syslog_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Syslog RFC 5424 string streaming parser +r"""jc - JSON Convert Syslog RFC 5424 string streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/systemctl.py b/jc/parsers/systemctl.py index 9d648449..1f7bd0bb 100644 --- a/jc/parsers/systemctl.py +++ b/jc/parsers/systemctl.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `systemctl` command output parser +r"""jc - JSON Convert `systemctl` command output parser Usage (cli): diff --git a/jc/parsers/systemctl_lj.py b/jc/parsers/systemctl_lj.py index 0c7ecf04..fd0ad10d 100644 --- a/jc/parsers/systemctl_lj.py +++ b/jc/parsers/systemctl_lj.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `systemctl list-jobs` command output parser +r"""jc - JSON Convert `systemctl list-jobs` command output parser Usage (cli): diff --git a/jc/parsers/systemctl_ls.py b/jc/parsers/systemctl_ls.py index df4baecf..15fe4ee5 100644 --- a/jc/parsers/systemctl_ls.py +++ b/jc/parsers/systemctl_ls.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `systemctl list-sockets` command output +r"""jc - JSON Convert `systemctl list-sockets` command output parser Usage (cli): diff --git a/jc/parsers/systemctl_luf.py b/jc/parsers/systemctl_luf.py index a7019c1d..504af4ac 100644 --- a/jc/parsers/systemctl_luf.py +++ b/jc/parsers/systemctl_luf.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `systemctl list-unit-files` command output +r"""jc - JSON Convert `systemctl list-unit-files` command output parser Usage (cli): diff --git a/jc/parsers/timedatectl.py b/jc/parsers/timedatectl.py index 684bc93b..f27f8984 100644 --- a/jc/parsers/timedatectl.py +++ b/jc/parsers/timedatectl.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `timedatectl` command output parser +r"""jc - JSON Convert `timedatectl` command output parser Also supports the `timesync-status` option. diff --git a/jc/parsers/timestamp.py b/jc/parsers/timestamp.py index 0c71d385..68f6a601 100644 --- a/jc/parsers/timestamp.py +++ b/jc/parsers/timestamp.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Unix Epoch Timestamp string parser +r"""jc - JSON Convert Unix Epoch Timestamp string parser The naive fields are based on the local time of the system the parser is run on. diff --git a/jc/parsers/toml.py b/jc/parsers/toml.py index 8fe3ff65..f0145f70 100644 --- a/jc/parsers/toml.py +++ b/jc/parsers/toml.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert TOML file parser +r"""jc - JSON Convert TOML file parser Usage (cli): diff --git a/jc/parsers/top.py b/jc/parsers/top.py index 5ca4717c..2b87f22b 100644 --- a/jc/parsers/top.py +++ b/jc/parsers/top.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `top -b` command output parser +r"""jc - JSON Convert `top -b` command output parser Requires batch mode (`-b`). The `-n` option must also be used to limit the number of times `top` is run. diff --git a/jc/parsers/top_s.py b/jc/parsers/top_s.py index 34d76750..38a94086 100644 --- a/jc/parsers/top_s.py +++ b/jc/parsers/top_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `top -b` command output streaming parser +r"""jc - JSON Convert `top -b` command output streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/tracepath.py b/jc/parsers/tracepath.py index 929ff1ec..e25c51c1 100644 --- a/jc/parsers/tracepath.py +++ b/jc/parsers/tracepath.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `tracepath` command output parser +r"""jc - JSON Convert `tracepath` command output parser Supports `tracepath` and `tracepath6` output. diff --git a/jc/parsers/traceroute.py b/jc/parsers/traceroute.py index fe6824be..41a9890c 100644 --- a/jc/parsers/traceroute.py +++ b/jc/parsers/traceroute.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `traceroute` command output parser +r"""jc - JSON Convert `traceroute` command output parser Supports `traceroute` and `traceroute6` output. diff --git a/jc/parsers/tune2fs.py b/jc/parsers/tune2fs.py index 9637733b..6ba50861 100644 --- a/jc/parsers/tune2fs.py +++ b/jc/parsers/tune2fs.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `tune2fs -l` command output parser +r"""jc - JSON Convert `tune2fs -l` command output parser Usage (cli): diff --git a/jc/parsers/ufw.py b/jc/parsers/ufw.py index d3ca7cff..bfacada3 100644 --- a/jc/parsers/ufw.py +++ b/jc/parsers/ufw.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ufw status` command output parser +r"""jc - JSON Convert `ufw status` command output parser Usage (cli): diff --git a/jc/parsers/ufw_appinfo.py b/jc/parsers/ufw_appinfo.py index be6410c9..c2824165 100644 --- a/jc/parsers/ufw_appinfo.py +++ b/jc/parsers/ufw_appinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `ufw app info [application]` command +r"""jc - JSON Convert `ufw app info [application]` command output parser Supports individual apps via `ufw app info [application]` and all apps list diff --git a/jc/parsers/uname.py b/jc/parsers/uname.py index fb4304af..ab09bf81 100644 --- a/jc/parsers/uname.py +++ b/jc/parsers/uname.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `uname -a` command output parser +r"""jc - JSON Convert `uname -a` command output parser > Note: Must use `uname -a` diff --git a/jc/parsers/universal.py b/jc/parsers/universal.py index c476803a..4ee7a5be 100644 --- a/jc/parsers/universal.py +++ b/jc/parsers/universal.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert universal parsers""" +r"""jc - JSON Convert universal parsers""" from typing import Iterable, List, Dict diff --git a/jc/parsers/update_alt_gs.py b/jc/parsers/update_alt_gs.py index 633e2a5c..ad3e9d72 100644 --- a/jc/parsers/update_alt_gs.py +++ b/jc/parsers/update_alt_gs.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `update-alternatives --get-selections` command output parser +r"""jc - JSON Convert `update-alternatives --get-selections` command output parser Usage (cli): diff --git a/jc/parsers/update_alt_q.py b/jc/parsers/update_alt_q.py index 6f35e56d..e9733e0f 100644 --- a/jc/parsers/update_alt_q.py +++ b/jc/parsers/update_alt_q.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `update-alternatives --query` command output parser +r"""jc - JSON Convert `update-alternatives --query` command output parser Usage (cli): diff --git a/jc/parsers/upower.py b/jc/parsers/upower.py index a659717f..626556d9 100644 --- a/jc/parsers/upower.py +++ b/jc/parsers/upower.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `upower` command output parser +r"""jc - JSON Convert `upower` command output parser The `updated_epoch` calculated timestamp field is naive. (i.e. based on the local time of the system the parser is run on) diff --git a/jc/parsers/uptime.py b/jc/parsers/uptime.py index 39d63906..2e9d31fa 100644 --- a/jc/parsers/uptime.py +++ b/jc/parsers/uptime.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `uptime` command output parser +r"""jc - JSON Convert `uptime` command output parser Usage (cli): diff --git a/jc/parsers/ver.py b/jc/parsers/ver.py index 8a5b35fe..084fbed9 100644 --- a/jc/parsers/ver.py +++ b/jc/parsers/ver.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert Version string output parser +r"""jc - JSON Convert Version string output parser Best-effort attempt to parse various styles of version numbers. This parser is based off of the version parser included in the CPython distutils diff --git a/jc/parsers/veracrypt.py b/jc/parsers/veracrypt.py index 3afecd69..af1051d6 100644 --- a/jc/parsers/veracrypt.py +++ b/jc/parsers/veracrypt.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `veracrypt` command output parser +r"""jc - JSON Convert `veracrypt` command output parser Supports the following `veracrypt` subcommands: - `veracrypt --text --list` diff --git a/jc/parsers/vmstat.py b/jc/parsers/vmstat.py index 6f4c9048..c6c41d6c 100644 --- a/jc/parsers/vmstat.py +++ b/jc/parsers/vmstat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `vmstat` command output parser +r"""jc - JSON Convert `vmstat` command output parser Options supported: `-a`, `-w`, `-d`, `-t` diff --git a/jc/parsers/vmstat_s.py b/jc/parsers/vmstat_s.py index 6df5964b..a52c9bda 100644 --- a/jc/parsers/vmstat_s.py +++ b/jc/parsers/vmstat_s.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `vmstat` command output streaming parser +r"""jc - JSON Convert `vmstat` command output streaming parser > This streaming parser outputs JSON Lines (cli) or returns an Iterable of > Dictionaries (module) diff --git a/jc/parsers/w.py b/jc/parsers/w.py index c1b764d3..38c730cb 100644 --- a/jc/parsers/w.py +++ b/jc/parsers/w.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `w` command output parser +r"""jc - JSON Convert `w` command output parser Usage (cli): diff --git a/jc/parsers/wc.py b/jc/parsers/wc.py index 49f64a5b..738ebf65 100644 --- a/jc/parsers/wc.py +++ b/jc/parsers/wc.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `wc` command output parser +r"""jc - JSON Convert `wc` command output parser Usage (cli): diff --git a/jc/parsers/who.py b/jc/parsers/who.py index 6c8cc784..ad6f582b 100644 --- a/jc/parsers/who.py +++ b/jc/parsers/who.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `who` command output parser +r"""jc - JSON Convert `who` command output parser Accepts any of the following who options (or no options): `-aTH` diff --git a/jc/parsers/x509_csr.py b/jc/parsers/x509_csr.py index 72066ad3..64fa8678 100644 --- a/jc/parsers/x509_csr.py +++ b/jc/parsers/x509_csr.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert X.509 Certificate Request format file parser +r"""jc - JSON Convert X.509 Certificate Request format file parser This parser will convert DER and PEM encoded X.509 certificate request files. diff --git a/jc/parsers/xml.py b/jc/parsers/xml.py index 3a5fa718..87ce0476 100644 --- a/jc/parsers/xml.py +++ b/jc/parsers/xml.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `XML` file parser +r"""jc - JSON Convert `XML` file parser This parser adds a `@` prefix to attributes by default. This can be changed to a `_` prefix by using the `-r` (cli) or `raw=True` (module) option. diff --git a/jc/parsers/xrandr.py b/jc/parsers/xrandr.py index 3d9e4021..ee27c3a7 100644 --- a/jc/parsers/xrandr.py +++ b/jc/parsers/xrandr.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `xrandr` command output parser +r"""jc - JSON Convert `xrandr` command output parser Usage (cli): diff --git a/jc/parsers/yaml.py b/jc/parsers/yaml.py index 2e2e2213..8a13a5b6 100644 --- a/jc/parsers/yaml.py +++ b/jc/parsers/yaml.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `YAML` file parser +r"""jc - JSON Convert `YAML` file parser > Note: `datetime` objects will be converted to strings. diff --git a/jc/parsers/zipinfo.py b/jc/parsers/zipinfo.py index a35265c2..6a878fa4 100644 --- a/jc/parsers/zipinfo.py +++ b/jc/parsers/zipinfo.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `zipinfo` command output parser +r"""jc - JSON Convert `zipinfo` command output parser > Note: No `zipinfo` options are supported. diff --git a/jc/parsers/zpool_iostat.py b/jc/parsers/zpool_iostat.py index bc838094..2758a79e 100644 --- a/jc/parsers/zpool_iostat.py +++ b/jc/parsers/zpool_iostat.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `zpool iostat` command output parser +r"""jc - JSON Convert `zpool iostat` command output parser Supports with or without the `-v` flag. diff --git a/jc/parsers/zpool_status.py b/jc/parsers/zpool_status.py index bce6c001..589e11cb 100644 --- a/jc/parsers/zpool_status.py +++ b/jc/parsers/zpool_status.py @@ -1,4 +1,4 @@ -"""jc - JSON Convert `zpool status` command output parser +r"""jc - JSON Convert `zpool status` command output parser Works with or without the `-v` option.