mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-04-03 17:44:07 +02:00
Compare commits
180 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac8120e1fe | ||
|
|
a854f1d6b0 | ||
|
|
7c9e92e284 | ||
|
|
4c2775970d | ||
|
|
ba0fc5dad9 | ||
|
|
222d1b7255 | ||
|
|
34fda0905f | ||
|
|
ccbe36e712 | ||
|
|
bb1136c33c | ||
|
|
c6a13aa4d8 | ||
|
|
d04a175d36 | ||
|
|
966df71566 | ||
|
|
c8599253fb | ||
|
|
65d9cc718f | ||
|
|
9b4190f1e6 | ||
|
|
c519657d85 | ||
|
|
d5cceb77e9 | ||
|
|
5cde110afb | ||
|
|
65aa6c1a9a | ||
|
|
5394d7f62d | ||
|
|
ebbd4e9320 | ||
|
|
834acfb2d6 | ||
|
|
1182c9f263 | ||
|
|
ed3046bb1b | ||
|
|
ca73076b56 | ||
|
|
9efc014dce | ||
|
|
dbe1757a48 | ||
|
|
1c09289d95 | ||
|
|
e9ccedf0d7 | ||
|
|
fb4b4eeb58 | ||
|
|
896891ad9e | ||
|
|
7fda79d841 | ||
|
|
8995ac686a | ||
|
|
006047553d | ||
|
|
c56e38c66c | ||
|
|
ee3b873ef4 | ||
|
|
a39cb05228 | ||
|
|
f54ceaa793 | ||
|
|
99cce72244 | ||
|
|
0c40e3a3c9 | ||
|
|
025d00ecd2 | ||
|
|
a2b5d41308 | ||
|
|
366589268e | ||
|
|
53dd28b65e | ||
|
|
0be6528aff | ||
|
|
6ceaa7749e | ||
|
|
6ae2e17ea1 | ||
|
|
ef9ca9322e | ||
|
|
95cba21d73 | ||
|
|
be1dd031f1 | ||
|
|
7fbe1e9f21 | ||
|
|
7d33850d43 | ||
|
|
7887789d0d | ||
|
|
7ddd2a4ce2 | ||
|
|
34ab34cc66 | ||
|
|
a8b231da81 | ||
|
|
2278c7ecab | ||
|
|
4cb88977cc | ||
|
|
0af4a3a5d7 | ||
|
|
c0f9b705c6 | ||
|
|
fa416083f2 | ||
|
|
e858faa746 | ||
|
|
a8f769eea3 | ||
|
|
26133261f9 | ||
|
|
6072ea0ec7 | ||
|
|
95672c23b7 | ||
|
|
a2e0e6d549 | ||
|
|
2df5e79295 | ||
|
|
c5e0642b0b | ||
|
|
78150ded70 | ||
|
|
05f3e4ea8a | ||
|
|
b7cf0ca8d4 | ||
|
|
ba6e1e694e | ||
|
|
aec3e3cd13 | ||
|
|
d9363ae473 | ||
|
|
0f367a435a | ||
|
|
0955598b49 | ||
|
|
f2a8e0087b | ||
|
|
97e9798cef | ||
|
|
413519e02c | ||
|
|
5c855e40c6 | ||
|
|
b66c5dbf55 | ||
|
|
b054b1b782 | ||
|
|
1593d0bf79 | ||
|
|
8a22f8a468 | ||
|
|
c26f0641ff | ||
|
|
40eb2b7ef6 | ||
|
|
71af0c5555 | ||
|
|
9f5532d91f | ||
|
|
c68c919024 | ||
|
|
9eb4df34b1 | ||
|
|
921133f3ac | ||
|
|
0350607359 | ||
|
|
5f8c65cf5b | ||
|
|
ed048c7b2b | ||
|
|
18dabd4b9f | ||
|
|
0005945383 | ||
|
|
e13605a6a9 | ||
|
|
a92e318319 | ||
|
|
7d8166326a | ||
|
|
d21e5f4f28 | ||
|
|
f1bab336ee | ||
|
|
0faacb6d0d | ||
|
|
6af82fb9ae | ||
|
|
517137889c | ||
|
|
8a3997cd0e | ||
|
|
4f66faad0d | ||
|
|
846f4fb691 | ||
|
|
5bec53b3f8 | ||
|
|
dfc942776b | ||
|
|
18a00bc57a | ||
|
|
e2b2406931 | ||
|
|
a9cfb4b13a | ||
|
|
3e57ecf6df | ||
|
|
2ddf67ad0c | ||
|
|
137c59cea1 | ||
|
|
8b2f57e8e7 | ||
|
|
01f5aa05b3 | ||
|
|
6ae626ef9f | ||
|
|
dea7099183 | ||
|
|
9c3e4f349c | ||
|
|
d5398c7089 | ||
|
|
2dcf0e2d1b | ||
|
|
f45295eee4 | ||
|
|
4ef34f7849 | ||
|
|
a69e55cb1c | ||
|
|
6563b9f073 | ||
|
|
6e17ed6f62 | ||
|
|
abda8735be | ||
|
|
79cb156441 | ||
|
|
1da080dc52 | ||
|
|
3ca8e1ef11 | ||
|
|
1d31d3570a | ||
|
|
b84123a09b | ||
|
|
475eedb142 | ||
|
|
ebd0432b82 | ||
|
|
ee1135003b | ||
|
|
aaee394e51 | ||
|
|
ad91a71488 | ||
|
|
c2adc46db4 | ||
|
|
3e9afca803 | ||
|
|
ee2a7ddc2e | ||
|
|
4fc7232d44 | ||
|
|
a0dff721b1 | ||
|
|
37061227d9 | ||
|
|
401b7b31b8 | ||
|
|
86a4bd12b5 | ||
|
|
50638cc11e | ||
|
|
36de08a6f8 | ||
|
|
83fa32f615 | ||
|
|
a3ca2814b3 | ||
|
|
5c06712fba | ||
|
|
fdadba226f | ||
|
|
5ac36befe2 | ||
|
|
527b5ab5c5 | ||
|
|
495c353c5d | ||
|
|
abbd4820fd | ||
|
|
5e88eb0c8b | ||
|
|
b0c98a56ce | ||
|
|
07e9b46535 | ||
|
|
87419750fc | ||
|
|
412a772b42 | ||
|
|
52a816cc45 | ||
|
|
48deacf875 | ||
|
|
7a377f7b8d | ||
|
|
e2f97d7d8e | ||
|
|
f9bf889654 | ||
|
|
026846650a | ||
|
|
850917ada0 | ||
|
|
bce4eb536a | ||
|
|
ef2a2121b5 | ||
|
|
4bed8392b8 | ||
|
|
8e2bcba352 | ||
|
|
588e5c2653 | ||
|
|
25085c3412 | ||
|
|
bfa99d99af | ||
|
|
b8f7ddcfc8 | ||
|
|
413ea4bc68 | ||
|
|
13948fff26 | ||
|
|
6275591ef1 |
63
.github/workflows/pythonapp.yml
vendored
63
.github/workflows/pythonapp.yml
vendored
@@ -9,12 +9,69 @@ on:
|
||||
- "**/*.py"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
very_old_python:
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-20.04, windows-latest]
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
os: [macos-13, windows-2019]
|
||||
python-version: ["3.6"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up timezone to America/Los_Angeles"
|
||||
uses: szenius/set-timezone@v1.2
|
||||
with:
|
||||
timezoneLinux: "America/Los_Angeles"
|
||||
timezoneMacos: "America/Los_Angeles"
|
||||
timezoneWindows: "Pacific Standard Time"
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Test with unittest
|
||||
run: |
|
||||
python -m unittest discover tests
|
||||
|
||||
old_python:
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-13, ubuntu-22.04, windows-2019]
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: "Set up timezone to America/Los_Angeles"
|
||||
uses: szenius/set-timezone@v1.2
|
||||
with:
|
||||
timezoneLinux: "America/Los_Angeles"
|
||||
timezoneMacos: "America/Los_Angeles"
|
||||
timezoneWindows: "Pacific Standard Time"
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
- name: Test with unittest
|
||||
run: |
|
||||
python -m unittest discover tests
|
||||
|
||||
latest_python:
|
||||
if: github.event.pull_request.draft == false
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [macos-latest, ubuntu-latest, windows-latest]
|
||||
python-version: ["3.11", "3.12"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
64
CHANGELOG
64
CHANGELOG
@@ -1,5 +1,69 @@
|
||||
jc changelog
|
||||
|
||||
20250503 v1.25.5
|
||||
- Add `amixer` command parser
|
||||
- Enhance `iptables` command parser to add default policy statistics fields
|
||||
- Fix `bluetoothctl` parser failing to parse controllers with power state prop
|
||||
- Fix `lsblk` command parser to support multiple mountpoints. Also, added
|
||||
byte conversions for size fields.
|
||||
- Fix `nmcli` command parser to support `team.config` JSON field
|
||||
- Fix `time` command parser for output that does not contain centiseconds
|
||||
- Fix `x509-cert` parser to handle IDNA2008 encoded email addresses with a warning
|
||||
- Fix typing for upcoming python v3.14
|
||||
- Fix timezone setting for tests to support minimal chrooted builds
|
||||
|
||||
20241125 v1.25.4
|
||||
- Add `ipconfig` command parser (`ipconfig` for Windows)
|
||||
- Add `pacman` command parser
|
||||
- Add `wg show` command parser
|
||||
- Enhance `ethtool` parser to support `link_partner_advertised_link_modes`
|
||||
- Enhance `ifconfig` parser to support `utun` interfaces with assigned IPv4 addresses on macOS
|
||||
- Enhance `nsd-control` parser with additional state fields
|
||||
- Enhance `ping-s` streaming parser to support error replies
|
||||
- Fix `bluetoothctl` parser when extra attributes like `manufacturer` and `version` exist
|
||||
- Fix `df` parser to correctly output binary vs. decimal size outputs
|
||||
- Fix `ip-address` parser for Python 3.13 changes to IPv4 mapped IPv6 addresses
|
||||
- Fix `iw-scan` parser to output more fields (still beta quality)
|
||||
- Fix `mount` parser for cases where there are spaces in the filesystem name
|
||||
- Fix `netstat` parser for cases where there are spaces in the program name
|
||||
- Fix `pkg-index-deb`, `apt-cache-show`, and `rpm-qi` parsers to correctly convert contiguous packages with the same name
|
||||
- Fix `traceroute` parser to support extreme IPv6 cases
|
||||
- Fix `uptime` parser for data that contains `user` instead of `users`
|
||||
- Fix `yaml` parser to support values that start with an equal sign
|
||||
- Enhance `jc.utils.convert_size_to_int()` to add `posix_mode` and `decimal_bias` parameters
|
||||
- Enhance cli to coerce any non-JSON-serializable objects to a string
|
||||
|
||||
20240609 v1.25.3
|
||||
- Enhance `bluetoothctl` parser with added `battery_percentage` field
|
||||
- Enhance `git-log` standard and streaming parsers with added `lines_changed` field under `file_stats`
|
||||
- Fix `lspci` parser to handle `physlot` fields with a range value
|
||||
- Fix `pci-ids` parser to correctly handle multiple subdevices
|
||||
- Fix `pip-show` parser to handle multi-line fields with a beginning blank line
|
||||
- Fix `ss` parser to correctly handle the `Recv-Q` field being too close to the `Status` field
|
||||
- Fix `top` parsers to quiet uptime info parsing
|
||||
- Fix `traceroute` parser to correctly handle hops with multiple IPs
|
||||
- Fix `zpool-status` parser for config items lacking data values
|
||||
- Optimize some tests by removing timezone settings and using quiet=True
|
||||
- Documentation updates
|
||||
|
||||
20240323 v1.25.2
|
||||
- Add `apt-cache-show` command parser
|
||||
- Add `apt-get-sqq` command parser
|
||||
- Add `ethtool` command parser
|
||||
- Add `needrestart` command parser
|
||||
- Enhance `df` parser to add human readable output support. Note: the `size`
|
||||
field has been changed to an integer and all size values have been normalized
|
||||
to bytes.
|
||||
- Enhance `free` parser to add human readable output support. All size values
|
||||
have been normalizd to bytes.
|
||||
- Enhance `iptables` parser to handle -x output
|
||||
- Enhance `/proc/pid/stat` parser to support "Idle" state
|
||||
- Enhance `rpm_qi` and `pkg_index_deb` parsers to split list fields into arrays
|
||||
- Fix `iwconfig` parser to handle more special characters in the SSID name
|
||||
- Fix `xrandr` parser to ignore extra horizontal and vertical stats lines
|
||||
- Add aarch64 binaries to Releases for macOS and Linux
|
||||
- Documentation and doc build updates
|
||||
|
||||
20240212 v1.25.1
|
||||
- Fix for crash when optional libraries are not installed (e.g. xmltodict)
|
||||
- Fix for `ini` parser crashing with some keys with no values
|
||||
|
||||
12
README.md
12
README.md
@@ -76,7 +76,7 @@ function parameter in `parse()` when using `jc` as a python library.
|
||||
Schemas for each parser can be found at the documentation link beside each
|
||||
[**Parser**](#parsers) below.
|
||||
|
||||
Release notes can be found [here](https://blog.kellybrazil.com/category/jc-news/).
|
||||
Release notes can be found in the [Releases section](https://github.com/kellyjonbrazil/jc/releases) on Github.
|
||||
|
||||
## Why Would Anyone Do This!?
|
||||
For more information on the motivations for this project, please see my blog
|
||||
@@ -159,6 +159,9 @@ option.
|
||||
| `--acpi` | `acpi` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/acpi) |
|
||||
| `--airport` | `airport -I` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport) |
|
||||
| `--airport-s` | `airport -s` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/airport_s) |
|
||||
| `--amixer` | `amixer` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/amixer) |
|
||||
| `--apt-cache-show` | `apt-cache show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/apt_cache_show) |
|
||||
| `--apt-get-sqq` | `apt-get -sqq` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/apt_get_sqq) |
|
||||
| `--arp` | `arp` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/arp) |
|
||||
| `--asciitable` | ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable) |
|
||||
| `--asciitable-m` | multi-line ASCII and Unicode table parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/asciitable_m) |
|
||||
@@ -189,6 +192,7 @@ option.
|
||||
| `--efibootmgr` | `efibootmgr` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/efibootmgr) |
|
||||
| `--email-address` | Email Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/email_address) |
|
||||
| `--env` | `env` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/env) |
|
||||
| `--ethtool` | `ethtool` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ethtool) |
|
||||
| `--file` | `file` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/file) |
|
||||
| `--find` | `find` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/find) |
|
||||
| `--findmnt` | `findmnt` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/findmnt) |
|
||||
@@ -215,6 +219,7 @@ option.
|
||||
| `--iostat` | `iostat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat) |
|
||||
| `--iostat-s` | `iostat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iostat_s) |
|
||||
| `--ip-address` | IPv4 and IPv6 Address string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_address) |
|
||||
| `--ipconfig` | `ipconfig` Windows command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ipconfig) |
|
||||
| `--iptables` | `iptables` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iptables) |
|
||||
| `--ip-route` | `ip route` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/ip_route) |
|
||||
| `--iw-scan` | `iw dev [device] scan` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/iw_scan) |
|
||||
@@ -239,6 +244,7 @@ option.
|
||||
| `--mount` | `mount` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mount) |
|
||||
| `--mpstat` | `mpstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat) |
|
||||
| `--mpstat-s` | `mpstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/mpstat_s) |
|
||||
| `--needrestart` | `needrestart -b` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/needrestart) |
|
||||
| `--netstat` | `netstat` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/netstat) |
|
||||
| `--nmcli` | `nmcli` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/nmcli) |
|
||||
| `--nsd-control` | `nsd-control` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/nsd_control) |
|
||||
@@ -246,6 +252,7 @@ option.
|
||||
| `--openvpn` | openvpn-status.log file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/openvpn) |
|
||||
| `--os-prober` | `os-prober` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/os_prober) |
|
||||
| `--os-release` | `/etc/os-release` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/os_release) |
|
||||
| `--pacman` | `pacman` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/pacman) |
|
||||
| `--passwd` | `/etc/passwd` file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/passwd) |
|
||||
| `--path` | POSIX path string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/path) |
|
||||
| `--path-list` | POSIX path list string parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/path_list) |
|
||||
@@ -312,6 +319,7 @@ option.
|
||||
| `--vmstat-s` | `vmstat` command streaming parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/vmstat_s) |
|
||||
| `--w` | `w` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/w) |
|
||||
| `--wc` | `wc` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wc) |
|
||||
| `--wg-show` | `wg show` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/wg_show) |
|
||||
| `--who` | `who` command parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/who) |
|
||||
| `--x509-cert` | X.509 PEM and DER certificate file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_cert) |
|
||||
| `--x509-csr` | X.509 PEM and DER certificate request file parser | [details](https://kellyjonbrazil.github.io/jc/docs/parsers/x509_csr) |
|
||||
@@ -1371,4 +1379,4 @@ cat istio.yaml | jc -p --yaml
|
||||
]
|
||||
```
|
||||
|
||||
© 2019-2024 Kelly Brazil
|
||||
© 2019-2025 Kelly Brazil
|
||||
@@ -3,8 +3,8 @@ _jc()
|
||||
local cur prev words cword jc_commands jc_parsers jc_options \
|
||||
jc_about_options jc_about_mod_options jc_help_options jc_special_options
|
||||
|
||||
jc_commands=(acpi airport arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env file findmnt finger free git gpg hciconfig host id ifconfig iostat ip iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat netstat nmcli nsd-control ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_commands=(acpi airport amixer apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
||||
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_options=(--force-color -C --debug -d --monochrome -m --meta-out -M --pretty -p --quiet -q --raw -r --slurp -s --unbuffer -u --yaml-out -y)
|
||||
jc_about_options=(--about -a)
|
||||
jc_about_mod_options=(--pretty -p --yaml-out -y --monochrome -m --force-color -C)
|
||||
|
||||
@@ -9,10 +9,13 @@ _jc() {
|
||||
jc_help_options jc_help_options_describe \
|
||||
jc_special_options jc_special_options_describe
|
||||
|
||||
jc_commands=(acpi airport arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env file findmnt finger free git gpg hciconfig host id ifconfig iostat ip iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat netstat nmcli nsd-control ntpq os-prober pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc who xrandr zipinfo zpool)
|
||||
jc_commands=(acpi airport amixer apt-cache apt-get arp blkid bluetoothctl cbt certbot chage cksum crontab curl date debconf-show df dig dmidecode dpkg du efibootmgr env ethtool file findmnt finger free git gpg hciconfig host id ifconfig iostat ip ipconfig iptables iw iwconfig jobs last lastb ls lsattr lsb_release lsblk lsmod lsof lspci lsusb md5 md5sum mdadm mount mpstat needrestart netstat nmcli nsd-control ntpq os-prober pacman pidstat ping ping6 pip pip3 postconf printenv ps route rpm rsync sfdisk sha1sum sha224sum sha256sum sha384sum sha512sum shasum ss ssh sshd stat sum swapon sysctl systemctl systeminfo timedatectl top tracepath tracepath6 traceroute traceroute6 tune2fs udevadm ufw uname update-alternatives upower uptime vdir veracrypt vmstat w wc wg who xrandr zipinfo zpool)
|
||||
jc_commands_describe=(
|
||||
'acpi:run "acpi" command with magic syntax.'
|
||||
'airport:run "airport" command with magic syntax.'
|
||||
'amixer:run "amixer" command with magic syntax.'
|
||||
'apt-cache:run "apt-cache" command with magic syntax.'
|
||||
'apt-get:run "apt-get" command with magic syntax.'
|
||||
'arp:run "arp" command with magic syntax.'
|
||||
'blkid:run "blkid" command with magic syntax.'
|
||||
'bluetoothctl:run "bluetoothctl" command with magic syntax.'
|
||||
@@ -31,6 +34,7 @@ _jc() {
|
||||
'du:run "du" command with magic syntax.'
|
||||
'efibootmgr:run "efibootmgr" command with magic syntax.'
|
||||
'env:run "env" command with magic syntax.'
|
||||
'ethtool:run "ethtool" command with magic syntax.'
|
||||
'file:run "file" command with magic syntax.'
|
||||
'findmnt:run "findmnt" command with magic syntax.'
|
||||
'finger:run "finger" command with magic syntax.'
|
||||
@@ -43,6 +47,7 @@ _jc() {
|
||||
'ifconfig:run "ifconfig" command with magic syntax.'
|
||||
'iostat:run "iostat" command with magic syntax.'
|
||||
'ip:run "ip" command with magic syntax.'
|
||||
'ipconfig:run "ipconfig" command with magic syntax.'
|
||||
'iptables:run "iptables" command with magic syntax.'
|
||||
'iw:run "iw" command with magic syntax.'
|
||||
'iwconfig:run "iwconfig" command with magic syntax.'
|
||||
@@ -62,11 +67,13 @@ _jc() {
|
||||
'mdadm:run "mdadm" command with magic syntax.'
|
||||
'mount:run "mount" command with magic syntax.'
|
||||
'mpstat:run "mpstat" command with magic syntax.'
|
||||
'needrestart:run "needrestart" command with magic syntax.'
|
||||
'netstat:run "netstat" command with magic syntax.'
|
||||
'nmcli:run "nmcli" command with magic syntax.'
|
||||
'nsd-control:run "nsd-control" command with magic syntax.'
|
||||
'ntpq:run "ntpq" command with magic syntax.'
|
||||
'os-prober:run "os-prober" command with magic syntax.'
|
||||
'pacman:run "pacman" command with magic syntax.'
|
||||
'pidstat:run "pidstat" command with magic syntax.'
|
||||
'ping:run "ping" command with magic syntax.'
|
||||
'ping6:run "ping6" command with magic syntax.'
|
||||
@@ -112,16 +119,20 @@ _jc() {
|
||||
'vmstat:run "vmstat" command with magic syntax.'
|
||||
'w:run "w" command with magic syntax.'
|
||||
'wc:run "wc" command with magic syntax.'
|
||||
'wg:run "wg" command with magic syntax.'
|
||||
'who:run "who" command with magic syntax.'
|
||||
'xrandr:run "xrandr" command with magic syntax.'
|
||||
'zipinfo:run "zipinfo" command with magic syntax.'
|
||||
'zpool:run "zpool" command with magic syntax.'
|
||||
)
|
||||
jc_parsers=(--acpi --airport --airport-s --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_parsers=(--acpi --airport --airport-s --amixer --apt-cache-show --apt-get-sqq --arp --asciitable --asciitable-m --blkid --bluetoothctl --cbt --cef --cef-s --certbot --chage --cksum --clf --clf-s --crontab --crontab-u --csv --csv-s --curl-head --date --datetime-iso --debconf-show --df --dig --dir --dmidecode --dpkg-l --du --efibootmgr --email-address --env --ethtool --file --find --findmnt --finger --free --fstab --git-log --git-log-s --git-ls-remote --gpg --group --gshadow --hash --hashsum --hciconfig --history --host --hosts --http-headers --id --ifconfig --ini --ini-dup --iostat --iostat-s --ip-address --ipconfig --iptables --ip-route --iw-scan --iwconfig --jar-manifest --jobs --jwt --kv --kv-dup --last --ls --ls-s --lsattr --lsb-release --lsblk --lsmod --lsof --lspci --lsusb --m3u --mdadm --mount --mpstat --mpstat-s --needrestart --netstat --nmcli --nsd-control --ntpq --openvpn --os-prober --os-release --pacman --passwd --path --path-list --pci-ids --pgpass --pidstat --pidstat-s --ping --ping-s --pip-list --pip-show --pkg-index-apk --pkg-index-deb --plist --postconf --proc --proc-buddyinfo --proc-cmdline --proc-consoles --proc-cpuinfo --proc-crypto --proc-devices --proc-diskstats --proc-filesystems --proc-interrupts --proc-iomem --proc-ioports --proc-loadavg --proc-locks --proc-meminfo --proc-modules --proc-mtrr --proc-pagetypeinfo --proc-partitions --proc-slabinfo --proc-softirqs --proc-stat --proc-swaps --proc-uptime --proc-version --proc-vmallocinfo --proc-vmstat --proc-zoneinfo --proc-driver-rtc --proc-net-arp --proc-net-dev --proc-net-dev-mcast --proc-net-if-inet6 --proc-net-igmp --proc-net-igmp6 --proc-net-ipv6-route --proc-net-netlink --proc-net-netstat --proc-net-packet --proc-net-protocols --proc-net-route --proc-net-tcp --proc-net-unix --proc-pid-fdinfo --proc-pid-io --proc-pid-maps --proc-pid-mountinfo --proc-pid-numa-maps --proc-pid-smaps --proc-pid-stat --proc-pid-statm --proc-pid-status --ps --resolve-conf --route --rpm-qi --rsync --rsync-s --semver --sfdisk --shadow --srt --ss --ssh-conf --sshd-conf --stat --stat-s --swapon --sysctl --syslog --syslog-s --syslog-bsd --syslog-bsd-s --systemctl --systemctl-lj --systemctl-ls --systemctl-luf --systeminfo --time --timedatectl --timestamp --toml --top --top-s --tracepath --traceroute --tune2fs --udevadm --ufw --ufw-appinfo --uname --update-alt-gs --update-alt-q --upower --uptime --url --ver --veracrypt --vmstat --vmstat-s --w --wc --wg-show --who --x509-cert --x509-csr --xml --xrandr --yaml --zipinfo --zpool-iostat --zpool-status)
|
||||
jc_parsers_describe=(
|
||||
'--acpi:`acpi` command parser'
|
||||
'--airport:`airport -I` command parser'
|
||||
'--airport-s:`airport -s` command parser'
|
||||
'--amixer:`amixer` command parser'
|
||||
'--apt-cache-show:`apt-cache show` command parser'
|
||||
'--apt-get-sqq:`apt-get -sqq` command parser'
|
||||
'--arp:`arp` command parser'
|
||||
'--asciitable:ASCII and Unicode table parser'
|
||||
'--asciitable-m:multi-line ASCII and Unicode table parser'
|
||||
@@ -152,6 +163,7 @@ _jc() {
|
||||
'--efibootmgr:`efibootmgr` command parser'
|
||||
'--email-address:Email Address string parser'
|
||||
'--env:`env` command parser'
|
||||
'--ethtool:`ethtool` command parser'
|
||||
'--file:`file` command parser'
|
||||
'--find:`find` command parser'
|
||||
'--findmnt:`findmnt` command parser'
|
||||
@@ -178,6 +190,7 @@ _jc() {
|
||||
'--iostat:`iostat` command parser'
|
||||
'--iostat-s:`iostat` command streaming parser'
|
||||
'--ip-address:IPv4 and IPv6 Address string parser'
|
||||
'--ipconfig:`ipconfig` Windows command parser'
|
||||
'--iptables:`iptables` command parser'
|
||||
'--ip-route:`ip route` command parser'
|
||||
'--iw-scan:`iw dev [device] scan` command parser'
|
||||
@@ -202,6 +215,7 @@ _jc() {
|
||||
'--mount:`mount` command parser'
|
||||
'--mpstat:`mpstat` command parser'
|
||||
'--mpstat-s:`mpstat` command streaming parser'
|
||||
'--needrestart:`needrestart -b` command parser'
|
||||
'--netstat:`netstat` command parser'
|
||||
'--nmcli:`nmcli` command parser'
|
||||
'--nsd-control:`nsd-control` command parser'
|
||||
@@ -209,6 +223,7 @@ _jc() {
|
||||
'--openvpn:openvpn-status.log file parser'
|
||||
'--os-prober:`os-prober` command parser'
|
||||
'--os-release:`/etc/os-release` file parser'
|
||||
'--pacman:`pacman` command parser'
|
||||
'--passwd:`/etc/passwd` file parser'
|
||||
'--path:POSIX path string parser'
|
||||
'--path-list:POSIX path list string parser'
|
||||
@@ -326,6 +341,7 @@ _jc() {
|
||||
'--vmstat-s:`vmstat` command streaming parser'
|
||||
'--w:`w` command parser'
|
||||
'--wc:`wc` command parser'
|
||||
'--wg-show:`wg show` command parser'
|
||||
'--who:`who` command parser'
|
||||
'--x509-cert:X.509 PEM and DER certificate file parser'
|
||||
'--x509-csr:X.509 PEM and DER certificate request file parser'
|
||||
|
||||
86
doc2md.py
Executable file
86
doc2md.py
Executable file
@@ -0,0 +1,86 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Convert parser doc string to markdown
|
||||
"""
|
||||
import sys
|
||||
import importlib
|
||||
from inspect import isfunction, signature, cleandoc
|
||||
import yapf # type: ignore
|
||||
|
||||
ignore_lib_functions = [
|
||||
'cast',
|
||||
'wraps',
|
||||
'lru_cache',
|
||||
'namedtuple'
|
||||
]
|
||||
|
||||
mod_path = sys.argv[1]
|
||||
mod_name = mod_path.split('.')[-1]
|
||||
module = importlib.import_module(f'{mod_path}')
|
||||
|
||||
######## HEADER ########
|
||||
header = f'''[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="{mod_path}"></a>
|
||||
|
||||
# {mod_path}
|
||||
'''
|
||||
|
||||
summary = module.__doc__ or ''
|
||||
|
||||
functions = []
|
||||
for attribute in dir(module):
|
||||
if isfunction(getattr(module, attribute)) \
|
||||
and not getattr(module, attribute).__name__.startswith('_'):
|
||||
|
||||
if 'jc.parsers.' in mod_path and not 'universal' in mod_path:
|
||||
if attribute == 'parse':
|
||||
functions.append(attribute)
|
||||
|
||||
else:
|
||||
if not attribute in ignore_lib_functions:
|
||||
functions.append(attribute)
|
||||
|
||||
######## TABLE OF CONTENTS ########
|
||||
toc = f'## Table of Contents\n\n* [{mod_path}](#{mod_path})\n'
|
||||
for api in functions:
|
||||
toc = f'{toc} * [{api}](#{mod_path}.{api})\n'
|
||||
|
||||
######## API DOCS ########
|
||||
api_docs = ''
|
||||
for api in functions:
|
||||
api_function = getattr(module, api)
|
||||
|
||||
this_header = f'<a id="{mod_path}.{api}"></a>\n\n### {api}\n'
|
||||
this_sig = str(signature(api_function))
|
||||
formatted_sig = yapf.yapf_api.FormatCode(f'def {api_function.__name__}{this_sig}:\n pass' )
|
||||
formatted_sig = formatted_sig[0].split(':\n pass')[0]
|
||||
this_name_and_sig = f'{this_header}\n```python\n{formatted_sig}\n```'
|
||||
|
||||
this_doc = cleandoc(api_function.__doc__)
|
||||
api_docs = api_docs + this_name_and_sig + '\n\n' + this_doc + '\n\n'
|
||||
|
||||
######## FOOTER ########
|
||||
footer = ''
|
||||
if 'jc.parsers.' in mod_path and not 'universal' in mod_path:
|
||||
footer = '### Parser Information\n'
|
||||
comp = ', '.join(module.info.compatible)
|
||||
ver = module.info.version
|
||||
author = module.info.author
|
||||
author_email = module.info.author_email
|
||||
slurpable = 'slurpable' in module.info.tags
|
||||
footer = footer + f'Compatibility: {comp}\n\n'
|
||||
footer = footer + f'Source: [`jc/parsers/{mod_name}.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/{mod_name}.py)\n\n'
|
||||
if slurpable:
|
||||
footer = footer + 'This parser can be used with the `--slurp` command-line option.\n\n'
|
||||
footer = footer + f'Version {ver} by {author} ({author_email})'
|
||||
|
||||
final_doc = ''
|
||||
if 'jc.parsers.' in mod_path and not 'universal' in mod_path:
|
||||
final_doc = header + '\n' + summary + '\n' + api_docs + footer
|
||||
elif mod_path == 'jc':
|
||||
final_doc = header + '\n' + summary
|
||||
else:
|
||||
final_doc = header + '\n' + toc + '\n' + summary + '\n\n' + api_docs
|
||||
|
||||
print(final_doc)
|
||||
110
docgen.sh
110
docgen.sh
@@ -1,107 +1,32 @@
|
||||
#!/bin/bash
|
||||
# Generate docs.md
|
||||
# requires pydoc-markdown 4.6.1
|
||||
|
||||
# Generate markdown document files (*.md)
|
||||
# Requires the yapf python library
|
||||
# use ./docgen all to generate all docs
|
||||
|
||||
readme_config=$(cat <<'EOF'
|
||||
{
|
||||
"processors": [
|
||||
{
|
||||
"type": "filter"
|
||||
},
|
||||
{
|
||||
"type": "pydocmd"
|
||||
}
|
||||
],
|
||||
"renderer": {
|
||||
"type": "markdown",
|
||||
"header_level_by_type": {
|
||||
"Module": 1,
|
||||
"Class": 3,
|
||||
"Method": 3,
|
||||
"Function": 3,
|
||||
"Variable": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
toc_config=$(cat <<'EOF'
|
||||
{
|
||||
"processors": [
|
||||
{
|
||||
"type": "filter"
|
||||
},
|
||||
{
|
||||
"type": "pydocmd"
|
||||
}
|
||||
],
|
||||
"renderer": {
|
||||
"type": "markdown",
|
||||
"render_toc": true,
|
||||
"header_level_by_type": {
|
||||
"Module": 1,
|
||||
"Class": 3,
|
||||
"Method": 3,
|
||||
"Function": 3,
|
||||
"Variable": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
parser_config=$(cat <<'EOF'
|
||||
{
|
||||
"processors": [
|
||||
{
|
||||
"type": "filter",
|
||||
"expression": "not name == \"info\" and not name.startswith(\"_\") and default()"
|
||||
},
|
||||
{
|
||||
"type": "pydocmd"
|
||||
}
|
||||
],
|
||||
"renderer": {
|
||||
"type": "markdown",
|
||||
"header_level_by_type": {
|
||||
"Module": 1,
|
||||
"Class": 3,
|
||||
"Method": 3,
|
||||
"Function": 3,
|
||||
"Variable": 3
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
cd jc
|
||||
(
|
||||
echo Building docs for: package
|
||||
pydoc-markdown -m jc "${readme_config}" > ../docs/readme.md; echo "+++ package docs complete"
|
||||
../doc2md.py jc > ../docs/readme.md && echo "+++ package docs complete" || echo "*** PACKAGE DOCS FAILED ***"
|
||||
) &
|
||||
|
||||
(
|
||||
echo Building docs for: lib
|
||||
pydoc-markdown -m jc.lib "${toc_config}" > ../docs/lib.md; echo "+++ lib docs complete"
|
||||
../doc2md.py jc.lib > ../docs/lib.md && echo "+++ lib docs complete" || echo "*** LIB DOCS FAILED ***"
|
||||
) &
|
||||
|
||||
(
|
||||
echo Building docs for: utils
|
||||
pydoc-markdown -m jc.utils "${toc_config}" > ../docs/utils.md; echo "+++ utils docs complete"
|
||||
../doc2md.py jc.utils > ../docs/utils.md && echo "+++ utils docs complete" || echo "*** UTILS DOCS FAILED ***"
|
||||
) &
|
||||
|
||||
(
|
||||
echo Building docs for: streaming
|
||||
pydoc-markdown -m jc.streaming "${toc_config}" > ../docs/streaming.md; echo "+++ streaming docs complete"
|
||||
../doc2md.py jc.streaming > ../docs/streaming.md && echo "+++ streaming docs complete" || echo "*** STREAMING DOCS FAILED ***"
|
||||
) &
|
||||
|
||||
(
|
||||
echo Building docs for: universal parser
|
||||
pydoc-markdown -m jc.parsers.universal "${toc_config}" > ../docs/parsers/universal.md; echo "+++ universal parser docs complete"
|
||||
../doc2md.py jc.parsers.universal > ../docs/parsers/universal.md && echo "+++ universal parser docs complete" || echo "*** UNIVERSAL PARSER DOCS FAILED ***"
|
||||
) &
|
||||
|
||||
# a bit of inception here... jc is being used to help
|
||||
@@ -119,27 +44,8 @@ for parser in "${parsers[@]}"; do
|
||||
parser_name=$(jq -r '.name' <<< "$parser")
|
||||
{
|
||||
if [[ $1 == "all" ]] || ! git diff --quiet --exit-code HEAD~5 -- "parsers/${parser_name}.py"; then
|
||||
compatible=$(jq -r '.compatible | join(", ")' <<< "$parser")
|
||||
version=$(jq -r '.version' <<< "$parser")
|
||||
author=$(jq -r '.author' <<< "$parser")
|
||||
author_email=$(jq -r '.author_email' <<< "$parser")
|
||||
|
||||
echo "Building docs for: ${parser_name}"
|
||||
echo "[Home](https://kellyjonbrazil.github.io/jc/)" > ../docs/parsers/"${parser_name}".md
|
||||
pydoc-markdown -m jc.parsers."${parser_name}" "${parser_config}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "### Parser Information" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Compatibility: ${compatible}" >> ../docs/parsers/"${parser_name}".md
|
||||
echo >> ../docs/parsers/"${parser_name}".md
|
||||
echo "Source: [\`jc/parsers/${parser_name}.py\`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/${parser_name}.py)" >> ../docs/parsers/"${parser_name}".md
|
||||
echo >> ../docs/parsers/"${parser_name}".md
|
||||
|
||||
if $(jq -e '.tags | contains(["slurpable"])' <<< "$parser"); then
|
||||
echo "This parser can be used with the \`--slurp\` command-line option." >> ../docs/parsers/"${parser_name}".md
|
||||
echo >> ../docs/parsers/"${parser_name}".md
|
||||
fi
|
||||
|
||||
echo "Version ${version} by ${author} (${author_email})" >> ../docs/parsers/"${parser_name}".md
|
||||
echo "+++ ${parser_name} docs complete"
|
||||
../doc2md.py jc.parsers."${parser_name}" > ../docs/parsers/"${parser_name}".md && echo "+++ ${parser_name} docs complete" || echo "*** ${parser_name} DOCS FAILED ***"
|
||||
fi
|
||||
} &
|
||||
done
|
||||
|
||||
211
docs/lib.md
211
docs/lib.md
@@ -1,29 +1,67 @@
|
||||
# Table of Contents
|
||||
|
||||
* [jc.lib](#jc.lib)
|
||||
* [get\_parser](#jc.lib.get_parser)
|
||||
* [parse](#jc.lib.parse)
|
||||
* [parser\_mod\_list](#jc.lib.parser_mod_list)
|
||||
* [plugin\_parser\_mod\_list](#jc.lib.plugin_parser_mod_list)
|
||||
* [standard\_parser\_mod\_list](#jc.lib.standard_parser_mod_list)
|
||||
* [streaming\_parser\_mod\_list](#jc.lib.streaming_parser_mod_list)
|
||||
* [slurpable\_parser\_mod\_list](#jc.lib.slurpable_parser_mod_list)
|
||||
* [parser\_info](#jc.lib.parser_info)
|
||||
* [all\_parser\_info](#jc.lib.all_parser_info)
|
||||
* [get\_help](#jc.lib.get_help)
|
||||
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.lib"></a>
|
||||
|
||||
# jc.lib
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [jc.lib](#jc.lib)
|
||||
* [all_parser_info](#jc.lib.all_parser_info)
|
||||
* [get_help](#jc.lib.get_help)
|
||||
* [get_parser](#jc.lib.get_parser)
|
||||
* [parse](#jc.lib.parse)
|
||||
* [parser_info](#jc.lib.parser_info)
|
||||
* [parser_mod_list](#jc.lib.parser_mod_list)
|
||||
* [plugin_parser_mod_list](#jc.lib.plugin_parser_mod_list)
|
||||
* [slurpable_parser_mod_list](#jc.lib.slurpable_parser_mod_list)
|
||||
* [standard_parser_mod_list](#jc.lib.standard_parser_mod_list)
|
||||
* [streaming_parser_mod_list](#jc.lib.streaming_parser_mod_list)
|
||||
|
||||
jc - JSON Convert lib module
|
||||
|
||||
<a id="jc.lib.all_parser_info"></a>
|
||||
|
||||
### all_parser_info
|
||||
|
||||
```python
|
||||
def all_parser_info(
|
||||
documentation: bool = False,
|
||||
show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[jc.jc_types.ParserInfoType]
|
||||
```
|
||||
|
||||
Returns a list of dictionaries that includes metadata for all parser
|
||||
modules. By default only non-hidden, non-deprecated parsers are
|
||||
returned.
|
||||
|
||||
Parameters:
|
||||
|
||||
documentation: (boolean) include parser docstrings if True
|
||||
show_hidden: (boolean) also show parsers marked as hidden
|
||||
in their info metadata.
|
||||
show_deprecated: (boolean) also show parsers marked as
|
||||
deprecated in their info metadata.
|
||||
|
||||
<a id="jc.lib.get_help"></a>
|
||||
|
||||
### get_help
|
||||
|
||||
```python
|
||||
def get_help(parser_mod_name: Union[str, module]) -> None
|
||||
```
|
||||
|
||||
Show help screen for the selected parser.
|
||||
|
||||
This function will accept **module_name**, **cli-name**, and
|
||||
**--argument-name** variants of the module name string as well as a
|
||||
parser module object.
|
||||
|
||||
<a id="jc.lib.get_parser"></a>
|
||||
|
||||
### get\_parser
|
||||
### get_parser
|
||||
|
||||
```python
|
||||
def get_parser(parser_mod_name: Union[str, ModuleType]) -> ModuleType
|
||||
def get_parser(parser_mod_name: Union[str, module]) -> module
|
||||
```
|
||||
|
||||
Return the parser module object and check that the module is a valid
|
||||
@@ -56,13 +94,13 @@ Raises:
|
||||
|
||||
```python
|
||||
def parse(
|
||||
parser_mod_name: Union[str, ModuleType],
|
||||
parser_mod_name: Union[str, module],
|
||||
data: Union[str, bytes, Iterable[str]],
|
||||
quiet: bool = False,
|
||||
raw: bool = False,
|
||||
ignore_exceptions: Optional[bool] = None,
|
||||
**kwargs
|
||||
) -> Union[JSONDictType, List[JSONDictType], Iterator[JSONDictType]]
|
||||
) -> Union[Dict[str, Any], List[Dict[str, Any]], Iterator[Dict[str, Any]]]
|
||||
```
|
||||
|
||||
Parse the data (string or bytes) using the supplied parser (string or
|
||||
@@ -152,73 +190,13 @@ Returns:
|
||||
Standard Parsers: Dictionary or List of Dictionaries
|
||||
Streaming Parsers: Generator Object containing Dictionaries
|
||||
|
||||
<a id="jc.lib.parser_mod_list"></a>
|
||||
|
||||
### parser\_mod\_list
|
||||
|
||||
```python
|
||||
def parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of all available parser module names.
|
||||
|
||||
<a id="jc.lib.plugin_parser_mod_list"></a>
|
||||
|
||||
### plugin\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def plugin_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of plugin parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
<a id="jc.lib.standard_parser_mod_list"></a>
|
||||
|
||||
### standard\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def standard_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of standard parser module names. This function is a
|
||||
subset of `parser_mod_list()` and does not contain any streaming
|
||||
parsers.
|
||||
|
||||
<a id="jc.lib.streaming_parser_mod_list"></a>
|
||||
|
||||
### streaming\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def streaming_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of streaming parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
<a id="jc.lib.slurpable_parser_mod_list"></a>
|
||||
|
||||
### slurpable\_parser\_mod\_list
|
||||
|
||||
```python
|
||||
def slurpable_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of slurpable parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
<a id="jc.lib.parser_info"></a>
|
||||
|
||||
### parser\_info
|
||||
### parser_info
|
||||
|
||||
```python
|
||||
def parser_info(parser_mod_name: Union[str, ModuleType],
|
||||
documentation: bool = False) -> ParserInfoType
|
||||
def parser_info(parser_mod_name: Union[str, module],
|
||||
documentation: bool = False) -> jc.jc_types.ParserInfoType
|
||||
```
|
||||
|
||||
Returns a dictionary that includes the parser module metadata.
|
||||
@@ -233,39 +211,64 @@ Parameters:
|
||||
|
||||
documentation: (boolean) include parser docstring if True
|
||||
|
||||
<a id="jc.lib.all_parser_info"></a>
|
||||
<a id="jc.lib.parser_mod_list"></a>
|
||||
|
||||
### all\_parser\_info
|
||||
### parser_mod_list
|
||||
|
||||
```python
|
||||
def all_parser_info(documentation: bool = False,
|
||||
show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[ParserInfoType]
|
||||
def parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of dictionaries that includes metadata for all parser
|
||||
modules. By default only non-hidden, non-deprecated parsers are
|
||||
returned.
|
||||
Returns a list of all available parser module names.
|
||||
|
||||
Parameters:
|
||||
<a id="jc.lib.plugin_parser_mod_list"></a>
|
||||
|
||||
documentation: (boolean) include parser docstrings if True
|
||||
show_hidden: (boolean) also show parsers marked as hidden
|
||||
in their info metadata.
|
||||
show_deprecated: (boolean) also show parsers marked as
|
||||
deprecated in their info metadata.
|
||||
|
||||
<a id="jc.lib.get_help"></a>
|
||||
|
||||
### get\_help
|
||||
### plugin_parser_mod_list
|
||||
|
||||
```python
|
||||
def get_help(parser_mod_name: Union[str, ModuleType]) -> None
|
||||
def plugin_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Show help screen for the selected parser.
|
||||
Returns a list of plugin parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
<a id="jc.lib.slurpable_parser_mod_list"></a>
|
||||
|
||||
### slurpable_parser_mod_list
|
||||
|
||||
```python
|
||||
def slurpable_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of slurpable parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
<a id="jc.lib.standard_parser_mod_list"></a>
|
||||
|
||||
### standard_parser_mod_list
|
||||
|
||||
```python
|
||||
def standard_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of standard parser module names. This function is a
|
||||
subset of `parser_mod_list()` and does not contain any streaming
|
||||
parsers.
|
||||
|
||||
<a id="jc.lib.streaming_parser_mod_list"></a>
|
||||
|
||||
### streaming_parser_mod_list
|
||||
|
||||
```python
|
||||
def streaming_parser_mod_list(show_hidden: bool = False,
|
||||
show_deprecated: bool = False) -> List[str]
|
||||
```
|
||||
|
||||
Returns a list of streaming parser module names. This function is a
|
||||
subset of `parser_mod_list()`.
|
||||
|
||||
This function will accept **module_name**, **cli-name**, and
|
||||
**--argument-name** variants of the module name string as well as a
|
||||
parser module object.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.airport_s"></a>
|
||||
|
||||
# jc.parsers.airport\_s
|
||||
# jc.parsers.airport_s
|
||||
|
||||
jc - JSON Convert `airport -s` command output parser
|
||||
|
||||
|
||||
117
docs/parsers/amixer.md
Normal file
117
docs/parsers/amixer.md
Normal file
@@ -0,0 +1,117 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.amixer"></a>
|
||||
|
||||
# jc.parsers.amixer
|
||||
|
||||
jc - JSON Convert `amixer sget` command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ amixer sget <control_name> | jc --amixer
|
||||
$ amixer sget Master | jc --amixer
|
||||
$ amixer sget Capture | jc --amixer
|
||||
$ amixer sget Speakers | jc --amixer
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('amixer', <amixer_sget_command_output>)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"control_name": string,
|
||||
"capabilities": [
|
||||
string
|
||||
],
|
||||
"playback_channels": [
|
||||
string
|
||||
],
|
||||
"limits": {
|
||||
"playback_min": integer,
|
||||
"playback_max": integer
|
||||
},
|
||||
"mono": {
|
||||
"playback_value": integer,
|
||||
"percentage": integer,
|
||||
"db": float,
|
||||
"status": boolean
|
||||
}
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ amixer sget Master | jc --amixer -p
|
||||
{
|
||||
"control_name": "Capture",
|
||||
"capabilities": [
|
||||
"cvolume",
|
||||
"cswitch"
|
||||
],
|
||||
"playback_channels": [],
|
||||
"limits": {
|
||||
"playback_min": 0,
|
||||
"playback_max": 63
|
||||
},
|
||||
"front_left": {
|
||||
"playback_value": 63,
|
||||
"percentage": 100,
|
||||
"db": 30.0,
|
||||
"status": true
|
||||
},
|
||||
"front_right": {
|
||||
"playback_value": 63,
|
||||
"percentage": 100,
|
||||
"db": 30.0,
|
||||
"status": true
|
||||
}
|
||||
}
|
||||
|
||||
$ amixer sget Master | jc --amixer -p -r
|
||||
{
|
||||
"control_name": "Master",
|
||||
"capabilities": [
|
||||
"pvolume",
|
||||
"pvolume-joined",
|
||||
"pswitch",
|
||||
"pswitch-joined"
|
||||
],
|
||||
"playback_channels": [
|
||||
"Mono"
|
||||
],
|
||||
"limits": {
|
||||
"playback_min": "0",
|
||||
"playback_max": "87"
|
||||
},
|
||||
"mono": {
|
||||
"playback_value": "87",
|
||||
"percentage": "100%",
|
||||
"db": "0.00db",
|
||||
"status": "on"
|
||||
}
|
||||
}
|
||||
|
||||
<a id="jc.parsers.amixer.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/amixer.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/amixer.py)
|
||||
|
||||
Version 1.0 by Eden Refael (edenraf@hotmail.com)
|
||||
180
docs/parsers/apt_cache_show.md
Normal file
180
docs/parsers/apt_cache_show.md
Normal file
@@ -0,0 +1,180 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.apt_cache_show"></a>
|
||||
|
||||
# jc.parsers.apt_cache_show
|
||||
|
||||
jc - JSON Convert `apt-cache show` command parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ apt-cache show | jc --apt-cache-show
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('apt_cache_show', apt_cache_show_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"package": string,
|
||||
"version": string,
|
||||
"installed_size": integer,
|
||||
"maintainer": string,
|
||||
"architecture": string,
|
||||
"depends": [
|
||||
string
|
||||
],
|
||||
"pre_depends": [
|
||||
string
|
||||
],
|
||||
"recommends": [
|
||||
string
|
||||
],
|
||||
"suggests": [
|
||||
string
|
||||
],
|
||||
"conflicts": [
|
||||
string
|
||||
],
|
||||
"breaks": [
|
||||
string
|
||||
],
|
||||
"description_md5": string,
|
||||
"multi_arch": string,
|
||||
"homepage": string,
|
||||
"section": string,
|
||||
"priority": string,
|
||||
"filename": string,
|
||||
"size": integer,
|
||||
"sha256": string,
|
||||
"description": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ apt-cache show | jc --apt-cache-show -p
|
||||
[
|
||||
{
|
||||
"package": "systemd",
|
||||
"version": "247.3-6~bpo10+1",
|
||||
"installed_size": 16121,
|
||||
"maintainer": "Debian systemd Maintainers <pkg-systemd-maintaine..",
|
||||
"architecture": "amd64",
|
||||
"depends": [
|
||||
"libacl1 (>= 2.2.23)",
|
||||
"libapparmor1 (>= 2.13)",
|
||||
"libaudit1 (>= 1:2.2.1)",
|
||||
"libcap2 (>= 1:2.10)",
|
||||
"libcryptsetup12 (>= 2:2.0.1)",
|
||||
"libgnutls30 (>= 3.6.6)",
|
||||
"libgpg-error0 (>= 1.14)",
|
||||
"libip4tc0 (>= 1.6.0+snapshot20161117)",
|
||||
"libkmod2 (>= 5~)",
|
||||
"liblz4-1 (>= 0.0~r130)",
|
||||
"libmount1 (>= 2.30)",
|
||||
"libpam0g (>= 0.99.7.1)",
|
||||
"libseccomp2 (>= 2.3.1)",
|
||||
"libsystemd0 (= 247.3-6~bpo10+1)",
|
||||
"systemd-timesyncd | time-daemon",
|
||||
"util-linux (>= 2.27.1)",
|
||||
"mount (>= 2.26)",
|
||||
"adduser"
|
||||
],
|
||||
"pre_depends": [
|
||||
"libblkid1 (>= 2.24)",
|
||||
"libc6 (>= 2.28)",
|
||||
"libgcrypt20 (>= 1.8.0)",
|
||||
"liblz4-1 (>= 0.0~r122)",
|
||||
"liblzma5 (>= 5.1.1alpha+20120614)",
|
||||
"libselinux1 (>= 2.1.9)",
|
||||
"libzstd1 (>= 1.4.0)"
|
||||
],
|
||||
"recommends": [
|
||||
"dbus"
|
||||
],
|
||||
"suggests": [
|
||||
"systemd-container",
|
||||
"policykit-1"
|
||||
],
|
||||
"conflicts": [
|
||||
"consolekit",
|
||||
"libpam-ck-connector"
|
||||
],
|
||||
"breaks": [
|
||||
"python-dbusmock (<< 0.18)",
|
||||
"python3-dbusmock (<< 0.18)",
|
||||
"resolvconf (<< 1.83~)",
|
||||
"systemd-shim (<< 10-4~)",
|
||||
"udev (<< 247~)"
|
||||
],
|
||||
"description_md5": "19399579cbc0c47a303288bf15eadcd4",
|
||||
"multi_arch": "foreign",
|
||||
"homepage": "https://www.freedesktop.org/wiki/Software/systemd",
|
||||
"section": "admin",
|
||||
"priority": "important",
|
||||
"filename": "pool/main/s/systemd/systemd_247.3-6~bpo10+1_amd64.deb",
|
||||
"size": 4382056,
|
||||
"sha256": "2035450655ad02faa0f75dc952128b503e51df5795c67273c0f6...",
|
||||
"description": "system and service manager systemd is a system..."
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
$ apt-cache show | jc --apt-cache-show -p -r
|
||||
[
|
||||
{
|
||||
"package": "systemd",
|
||||
"version": "247.3-6~bpo10+1",
|
||||
"installed_size": "16121",
|
||||
"maintainer": "Debian systemd Maintainers <pkg-systemd-maintain...",
|
||||
"architecture": "amd64",
|
||||
"depends": "libacl1 (>= 2.2.23), libapparmor1 (>= 2.13), libaud...",
|
||||
"pre_depends": "libblkid1 (>= 2.24), libc6 (>= 2.28), libgcrypt...",
|
||||
"recommends": "dbus",
|
||||
"suggests": "systemd-container, policykit-1",
|
||||
"conflicts": "consolekit, libpam-ck-connector",
|
||||
"breaks": "python-dbusmock (<< 0.18), python3-dbusmock (<< 0.18...",
|
||||
"description_md5": "19399579cbc0c47a303288bf15eadcd4",
|
||||
"multi_arch": "foreign",
|
||||
"homepage": "https://www.freedesktop.org/wiki/Software/systemd",
|
||||
"section": "admin",
|
||||
"priority": "important",
|
||||
"filename": "pool/main/s/systemd/systemd_247.3-6~bpo10+1_amd64.deb",
|
||||
"size": "4382056",
|
||||
"sha256": "2035450655ad02faa0f75dc952128b503e51df5795c67273c0f6...",
|
||||
"description": "system and service manager systemd is a system..."
|
||||
},
|
||||
...
|
||||
]
|
||||
|
||||
<a id="jc.parsers.apt_cache_show.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/apt_cache_show.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/apt_cache_show.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
201
docs/parsers/apt_get_sqq.md
Normal file
201
docs/parsers/apt_get_sqq.md
Normal file
@@ -0,0 +1,201 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.apt_get_sqq"></a>
|
||||
|
||||
# jc.parsers.apt_get_sqq
|
||||
|
||||
jc - JSON Convert `apt-get -sqq` command output parser
|
||||
|
||||
Requires the `-sqq` options in `apt-get`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ apt-get -sqq upgrade | jc --apt-get-sqq
|
||||
|
||||
or
|
||||
|
||||
$ jc apt-get -sqq full-upgrade
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('apt_get_sqq', apt_get_sqq_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"operation": string, # configure, remove, or unpack
|
||||
"package": string,
|
||||
"broken": string/null,
|
||||
"proposed_pkg_ver": string,
|
||||
"existing_pkg_ver": string/null,
|
||||
"architecture": string
|
||||
}
|
||||
]
|
||||
|
||||
Examples:
|
||||
|
||||
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
|
||||
[
|
||||
{
|
||||
"operation": "unpack",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "unpack",
|
||||
"package": "dpkg",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "configure",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "remove",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "unpack",
|
||||
"package": "base-files",
|
||||
"broken": "10.3+deb10u4",
|
||||
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": null,
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "configure",
|
||||
"package": "base-files",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": null,
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "unpack",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "configure",
|
||||
"package": "dpkg",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
}
|
||||
]
|
||||
|
||||
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
|
||||
[
|
||||
{
|
||||
"operation": "Inst",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Inst",
|
||||
"package": "dpkg",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Conf",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Remv",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Inst",
|
||||
"package": "base-files",
|
||||
"broken": "10.3+deb10u4",
|
||||
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": null,
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Conf",
|
||||
"package": "base-files",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": null,
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Inst",
|
||||
"package": "dpkg",
|
||||
"broken": "1.19.7",
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
},
|
||||
{
|
||||
"operation": "Conf",
|
||||
"package": "dpkg",
|
||||
"broken": null,
|
||||
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
|
||||
"existing_pkg_ver": "Debian-Security:10/oldstable",
|
||||
"architecture": "amd64"
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.apt_get_sqq.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/apt_get_sqq.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/apt_get_sqq.py)
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.asciitable_m"></a>
|
||||
|
||||
# jc.parsers.asciitable\_m
|
||||
# jc.parsers.asciitable_m
|
||||
|
||||
jc - JSON Convert `asciitable-m` parser
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ a controller and a device but there might be fields corresponding to one entity.
|
||||
Controller:
|
||||
[
|
||||
{
|
||||
"manufacturer": string,
|
||||
"version": string,
|
||||
"name": string,
|
||||
"is_default": boolean,
|
||||
"is_public": boolean,
|
||||
@@ -70,7 +72,8 @@ a controller and a device but there might be fields corresponding to one entity.
|
||||
"rssi": int,
|
||||
"txpower": int,
|
||||
"uuids": array,
|
||||
"modalias": string
|
||||
"modalias": string,
|
||||
"battery_percentage": int
|
||||
}
|
||||
]
|
||||
|
||||
@@ -101,7 +104,8 @@ Examples:
|
||||
"Headset HS (00001831-0000-1000-8000-00805f9b34fb)"
|
||||
],
|
||||
"rssi": -52,
|
||||
"txpower": 4
|
||||
"txpower": 4,
|
||||
"battery_percentage": 70
|
||||
}
|
||||
]
|
||||
|
||||
@@ -112,7 +116,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -132,4 +136,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/bluetoothctl.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/bluetoothctl.py)
|
||||
|
||||
Version 1.1 by Jake Ob (iakopap at gmail.com)
|
||||
Version 1.4 by Jake Ob (iakopap at gmail.com)
|
||||
|
||||
@@ -104,7 +104,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.cef_s"></a>
|
||||
|
||||
# jc.parsers.cef\_s
|
||||
# jc.parsers.cef_s
|
||||
|
||||
jc - JSON Convert CEF string output streaming parser
|
||||
|
||||
@@ -95,7 +95,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
|
||||
@@ -140,7 +140,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -178,7 +178,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.clf_s"></a>
|
||||
|
||||
# jc.parsers.clf\_s
|
||||
# jc.parsers.clf_s
|
||||
|
||||
jc - JSON Convert Common Log Format file streaming parser
|
||||
|
||||
@@ -88,11 +88,12 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False) -> StreamingOutputType
|
||||
def parse(
|
||||
data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
ignore_exceptions: bool = False
|
||||
) -> Iterator[Union[Dict[str, Any], Tuple[BaseException, str]]]
|
||||
```
|
||||
|
||||
Main text parsing generator function. Returns an iterable object.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.crontab_u"></a>
|
||||
|
||||
# jc.parsers.crontab\_u
|
||||
# jc.parsers.crontab_u
|
||||
|
||||
jc - JSON Convert `crontab -l` command output and crontab
|
||||
file parser
|
||||
|
||||
@@ -84,7 +84,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: Union[str, bytes],
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.csv_s"></a>
|
||||
|
||||
# jc.parsers.csv\_s
|
||||
# jc.parsers.csv_s
|
||||
|
||||
jc - JSON Convert `csv` file streaming parser
|
||||
|
||||
@@ -64,7 +64,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.curl_head"></a>
|
||||
|
||||
# jc.parsers.curl\_head
|
||||
# jc.parsers.curl_head
|
||||
|
||||
jc - JSON Convert `curl --head` command output parser
|
||||
|
||||
@@ -286,7 +286,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.datetime_iso"></a>
|
||||
|
||||
# jc.parsers.datetime\_iso
|
||||
# jc.parsers.datetime_iso
|
||||
|
||||
jc - JSON Convert ISO 8601 Datetime string parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.debconf_show"></a>
|
||||
|
||||
# jc.parsers.debconf\_show
|
||||
# jc.parsers.debconf_show
|
||||
|
||||
jc - JSON Convert `debconf-show` command output parser
|
||||
|
||||
@@ -84,7 +84,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
jc - JSON Convert `df` command output parser
|
||||
|
||||
Values are normalized to bytes when using `df -h`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ df | jc --df
|
||||
@@ -23,7 +25,7 @@ Schema:
|
||||
[
|
||||
{
|
||||
"filesystem": string,
|
||||
"size": string,
|
||||
"size": integer,
|
||||
"1k_blocks": integer,
|
||||
"512_blocks": integer,
|
||||
"used": integer,
|
||||
@@ -122,4 +124,4 @@ Compatibility: linux, darwin, freebsd
|
||||
|
||||
Source: [`jc/parsers/df.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/df.py)
|
||||
|
||||
Version 1.11 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.dpkg_l"></a>
|
||||
|
||||
# jc.parsers.dpkg\_l
|
||||
# jc.parsers.dpkg_l
|
||||
|
||||
jc - JSON Convert `dpkg -l` command output parser
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.email_address"></a>
|
||||
|
||||
# jc.parsers.email\_address
|
||||
# jc.parsers.email_address
|
||||
|
||||
jc - JSON Convert Email Address string parser
|
||||
|
||||
|
||||
197
docs/parsers/ethtool.md
Normal file
197
docs/parsers/ethtool.md
Normal file
@@ -0,0 +1,197 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ethtool"></a>
|
||||
|
||||
# jc.parsers.ethtool
|
||||
|
||||
jc - JSON Convert `ethtool` command output parser
|
||||
|
||||
Supports standard `ethtool` output and the `--module-info` option.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ ethtool <interface> | jc --ethtool
|
||||
$ ethtool --module-info <interface> | jc --ethtool
|
||||
|
||||
or
|
||||
|
||||
$ jc ethtool <interface>
|
||||
$ jc ethtool --module-info <interface>
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('ethtool', ethtool_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
Note: many units fields are converted to integers and floats
|
||||
when detected. Use raw output for the original string values.
|
||||
|
||||
{
|
||||
"name": string,
|
||||
"supported_ports": [
|
||||
string
|
||||
],
|
||||
"supported_link_modes": [
|
||||
string
|
||||
],
|
||||
"supported_pause_frame_use": string,
|
||||
"supports_auto_negotiation": boolean,
|
||||
"supported_fec_modes": [
|
||||
string
|
||||
],
|
||||
"advertised_link_modes": [
|
||||
string
|
||||
],
|
||||
"advertised_pause_frame_use": boolean,
|
||||
"advertised_auto_negotiation": boolean,
|
||||
"advertised_fec_modes": [
|
||||
string
|
||||
],
|
||||
"speed": string,
|
||||
"speed_bps": integer,
|
||||
"duplex": string,
|
||||
"auto_negotiation": boolean,
|
||||
"port": string,
|
||||
"phyad": string,
|
||||
"mdi_x": string,
|
||||
"transceiver": string,
|
||||
"supports_wake_on": string,
|
||||
"wake_on": string,
|
||||
"current_message_level": [
|
||||
string
|
||||
],
|
||||
"link_detected": boolean,
|
||||
"identifier": string,
|
||||
"extended_identifier": string,
|
||||
"connector": string,
|
||||
"transceiver_codes": string,
|
||||
"transceiver_type": [
|
||||
string
|
||||
],
|
||||
"encoding": string,
|
||||
"br_nominal": string,
|
||||
"rate_identifier": string,
|
||||
"length_smf_km": string,
|
||||
"length_smf": string,
|
||||
"length_50um": string,
|
||||
"length_62_5um": string,
|
||||
"length_copper": string,
|
||||
"length_om3": string,
|
||||
"passive_cu_cmplnce": string,
|
||||
"vendor_name": string,
|
||||
"vendor_oui": string,
|
||||
"vendor_pn": string,
|
||||
"vendor_rev": string,
|
||||
"option_values": string,
|
||||
"br_margin_max": string,
|
||||
"br_margin_min": string
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ ethtool enp0s3 | jc --ethtool -p
|
||||
{
|
||||
"name": "enp0s3",
|
||||
"supported_pause_frame_use": "No",
|
||||
"supports_auto_negotiation": true,
|
||||
"supported_fec_modes": "Not reported",
|
||||
"advertised_pause_frame_use": false,
|
||||
"advertised_auto_negotiation": true,
|
||||
"advertised_fec_modes": "Not reported",
|
||||
"speed": "1000Mb/s",
|
||||
"duplex": "Full",
|
||||
"port": "Twisted Pair",
|
||||
"phyad": "0",
|
||||
"transceiver": "internal",
|
||||
"auto_negotiation": false,
|
||||
"mdi_x": "off (auto)",
|
||||
"supports_wake_on": "umbg",
|
||||
"wake_on": "d",
|
||||
"link_detected": true,
|
||||
"supported_ports": [
|
||||
"TP"
|
||||
],
|
||||
"supported_link_modes": [
|
||||
"10baseT/Half",
|
||||
"10baseT/Full",
|
||||
"100baseT/Half",
|
||||
"100baseT/Full",
|
||||
"1000baseT/Full"
|
||||
],
|
||||
"advertised_link_modes": [
|
||||
"10baseT/Half",
|
||||
"10baseT/Full",
|
||||
"100baseT/Half",
|
||||
"100baseT/Full",
|
||||
"1000baseT/Full"
|
||||
],
|
||||
"current_message_level": [
|
||||
"0x00000007 (7)",
|
||||
"drv probe link"
|
||||
],
|
||||
"speed_bps": 1000000000
|
||||
}
|
||||
|
||||
$ ethtool --module-info enp0s3 | jc --ethtool -p
|
||||
{
|
||||
"identifier": "0x03 (SFP)",
|
||||
"extended_identifier": "0x04 (GBIC/SFP defined by 2-wire interface ID)",
|
||||
"connector": "0x21 (Copper pigtail)",
|
||||
"transceiver_codes": "0x01 0x00 0x00 0x04 0x00 0x04 0x80 0xd5 0x00",
|
||||
"transceiver_type": [
|
||||
"Infiniband: 1X Copper Passive",
|
||||
"Ethernet: 1000BASE-CX",
|
||||
"Passive Cable",
|
||||
"FC: Twin Axial Pair (TW)",
|
||||
"FC: 1200 MBytes/sec",
|
||||
"FC: 800 MBytes/sec",
|
||||
"FC: 400 MBytes/sec",
|
||||
"FC: 200 MBytes/sec",
|
||||
"FC: 100 MBytes/sec"
|
||||
],
|
||||
"encoding": "0x00 (unspecified)",
|
||||
"br_nominal": "10300MBd",
|
||||
"rate_identifier": "0x00 (unspecified)",
|
||||
"length_smf_km": "0km",
|
||||
"length_smf": "0m",
|
||||
"length_50um": "0m",
|
||||
"length_62_5um": "0m",
|
||||
"length_copper": "2m",
|
||||
"length_om3": "0m",
|
||||
"passive_cu_cmplnce": "0x01 (SFF-8431 appendix E) [SFF-8472 rev10.4 only]",
|
||||
"vendor_name": "UbiquitiNetworks",
|
||||
"vendor_oui": "00:40:20",
|
||||
"vendor_pn": "UDC-2",
|
||||
"vendor_rev": "",
|
||||
"option_values": "0x00 0x00",
|
||||
"br_margin_max": "0%",
|
||||
"br_margin_min": "0%"
|
||||
}
|
||||
|
||||
<a id="jc.parsers.ethtool.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/ethtool.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ethtool.py)
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -96,7 +96,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
jc - JSON Convert `free` command output parser
|
||||
|
||||
Values are normalized to bytes when using `free -h`.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ free | jc --free
|
||||
@@ -22,13 +24,13 @@ Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"type": string,
|
||||
"total": integer,
|
||||
"used": integer,
|
||||
"free": integer,
|
||||
"shared": integer,
|
||||
"buff_cache": integer,
|
||||
"available": integer
|
||||
"type": string,
|
||||
"total": integer,
|
||||
"used": integer,
|
||||
"free": integer,
|
||||
"shared": integer,
|
||||
"buff_cache": integer,
|
||||
"available": integer
|
||||
}
|
||||
]
|
||||
|
||||
@@ -97,4 +99,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/free.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/free.py)
|
||||
|
||||
Version 1.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.8 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.git_log"></a>
|
||||
|
||||
# jc.parsers.git\_log
|
||||
# jc.parsers.git_log
|
||||
|
||||
jc - JSON Convert `git log` command output parser
|
||||
|
||||
@@ -55,6 +55,12 @@ Schema:
|
||||
"deletions": integer,
|
||||
"files": [
|
||||
string
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": string,
|
||||
"lines_changed": integer
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -79,6 +85,16 @@ Examples:
|
||||
"files": [
|
||||
"docs/parsers/git_log.md",
|
||||
"jc/parsers/git_log.py"
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": "docs/parsers/git_log.md",
|
||||
"lines_changed": 3
|
||||
},
|
||||
{
|
||||
"name": "jc/parsers/git_log.py",
|
||||
"lines_changed": 7
|
||||
}
|
||||
]
|
||||
},
|
||||
"message": "add timestamp docs and examples",
|
||||
@@ -100,6 +116,28 @@ Examples:
|
||||
"jc/parsers/git_log.py",
|
||||
"jc/utils.py",
|
||||
"man/jc.1"
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": "docs/parsers/git_log.md",
|
||||
"lines_changed": 3
|
||||
},
|
||||
{
|
||||
"name": "docs/utils.md",
|
||||
"lines_changed": 7
|
||||
},
|
||||
{
|
||||
"name": "jc/parsers/git_log.py",
|
||||
"lines_changed": 1
|
||||
},
|
||||
{
|
||||
"name": "jc/utils.py",
|
||||
"lines_changed": 12
|
||||
},
|
||||
{
|
||||
"name": "man/jc.1",
|
||||
"lines_changed": 14
|
||||
}
|
||||
]
|
||||
},
|
||||
"message": "add calculated timestamp",
|
||||
@@ -123,6 +161,16 @@ Examples:
|
||||
"files": [
|
||||
"docs/parsers/git_log.md",
|
||||
"jc/parsers/git_log.py"
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": "docs/parsers/git_log.md",
|
||||
"lines_changed": "3"
|
||||
},
|
||||
{
|
||||
"name": "jc/parsers/git_log.py",
|
||||
"lines_changed": "7"
|
||||
}
|
||||
]
|
||||
},
|
||||
"message": "add timestamp docs and examples"
|
||||
@@ -142,6 +190,28 @@ Examples:
|
||||
"jc/parsers/git_log.py",
|
||||
"jc/utils.py",
|
||||
"man/jc.1"
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": "docs/parsers/git_log.md",
|
||||
"lines_changed": "3"
|
||||
},
|
||||
{
|
||||
"name": "docs/utils.md",
|
||||
"lines_changed": "7"
|
||||
},
|
||||
{
|
||||
"name": "jc/parsers/git_log.py",
|
||||
"lines_changed": "1"
|
||||
},
|
||||
{
|
||||
"name": "jc/utils.py",
|
||||
"lines_changed": "12"
|
||||
},
|
||||
{
|
||||
"name": "man/jc.1",
|
||||
"lines_changed": "14"
|
||||
}
|
||||
]
|
||||
},
|
||||
"message": "add calculated timestamp"
|
||||
@@ -174,4 +244,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/git_log.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/git_log.py)
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.git_log_s"></a>
|
||||
|
||||
# jc.parsers.git\_log\_s
|
||||
# jc.parsers.git_log_s
|
||||
|
||||
jc - JSON Convert `git log` command output streaming parser
|
||||
|
||||
@@ -56,6 +56,12 @@ Schema:
|
||||
"deletions": integer,
|
||||
"files": [
|
||||
string
|
||||
],
|
||||
"file_stats": [
|
||||
{
|
||||
"name": string,
|
||||
"lines_changed": integer
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -82,7 +88,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
@@ -110,4 +115,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/git_log_s.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/git_log_s.py)
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.git_ls_remote"></a>
|
||||
|
||||
# jc.parsers.git\_ls\_remote
|
||||
# jc.parsers.git_ls_remote
|
||||
|
||||
jc - JSON Convert `git ls-remote` command output parser
|
||||
|
||||
@@ -71,7 +71,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> Union[JSONDictType, List[JSONDictType]]
|
||||
quiet: bool = False) -> Union[Dict[str, Any], List[Dict[str, Any]]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.http_headers"></a>
|
||||
|
||||
# jc.parsers.http\_headers
|
||||
# jc.parsers.http_headers
|
||||
|
||||
jc - JSON Convert HTTP headers parser
|
||||
|
||||
@@ -313,7 +313,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -222,7 +222,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -242,4 +242,4 @@ Compatibility: linux, aix, freebsd, darwin
|
||||
|
||||
Source: [`jc/parsers/ifconfig.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ifconfig.py)
|
||||
|
||||
Version 2.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ini_dup"></a>
|
||||
|
||||
# jc.parsers.ini\_dup
|
||||
# jc.parsers.ini_dup
|
||||
|
||||
jc - JSON Convert INI with duplicate key file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.iostat_s"></a>
|
||||
|
||||
# jc.parsers.iostat\_s
|
||||
# jc.parsers.iostat_s
|
||||
|
||||
jc - JSON Convert `iostat` command output streaming parser
|
||||
|
||||
@@ -108,7 +108,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ip_address"></a>
|
||||
|
||||
# jc.parsers.ip\_address
|
||||
# jc.parsers.ip_address
|
||||
|
||||
jc - JSON Convert IP Address string parser
|
||||
|
||||
@@ -556,4 +556,4 @@ Source: [`jc/parsers/ip_address.py`](https://github.com/kellyjonbrazil/jc/blob/m
|
||||
|
||||
This parser can be used with the `--slurp` command-line option.
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ip_route"></a>
|
||||
|
||||
# jc.parsers.ip\_route
|
||||
# jc.parsers.ip_route
|
||||
|
||||
jc - JSON Convert `ip route` command output parser
|
||||
|
||||
|
||||
461
docs/parsers/ipconfig.md
Normal file
461
docs/parsers/ipconfig.md
Normal file
@@ -0,0 +1,461 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ipconfig"></a>
|
||||
|
||||
# jc.parsers.ipconfig
|
||||
|
||||
jc - JSON Convert `ipconfig` Windows command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ ipconfig /all | jc --ipconfig
|
||||
$ ipconfig | jc --ipconfig
|
||||
$ jc ipconfig /all
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('ipconfig', ipconfig_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"host_name": string,
|
||||
"primary_dns_suffix": string,
|
||||
"node_type": string,
|
||||
"ip_routing_enabled": boolean,
|
||||
"wins_proxy_enabled": boolean,
|
||||
"dns_suffix_search_list": [
|
||||
string
|
||||
],
|
||||
"adapters": [
|
||||
{
|
||||
"name_long": string,
|
||||
"name": string,
|
||||
"type": string,
|
||||
"connection_specific_dns_suffix": string,
|
||||
"connection_specific_dns_suffix_search_list": [
|
||||
string
|
||||
]
|
||||
"description": string,
|
||||
"physical_address": string,
|
||||
"dhcp_enabled": boolean,
|
||||
"autoconfiguration_enabled": boolean,
|
||||
"ipv6_addresses": [
|
||||
{
|
||||
"address": string,
|
||||
"status": string,
|
||||
},
|
||||
],
|
||||
"temporary_ipv6_addresses": [
|
||||
{
|
||||
"address": string,
|
||||
"status": string,
|
||||
},
|
||||
],
|
||||
"link_local_ipv6_addresses": [
|
||||
{
|
||||
"address": string,
|
||||
"status": string,
|
||||
"prefix_length": integer,
|
||||
}
|
||||
],
|
||||
"ipv4_addresses": [
|
||||
{
|
||||
"address": string, # [2]
|
||||
"subnet_mask": string,
|
||||
"status": string,
|
||||
"autoconfigured": boolean # [1]
|
||||
}
|
||||
],
|
||||
"default_gateways": [
|
||||
string
|
||||
],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": string,
|
||||
"dhcpv6_client_duid": string,
|
||||
"dns_servers": [
|
||||
string
|
||||
],
|
||||
"primary_wins_server": string,
|
||||
"lease_expires": string,
|
||||
"lease_expires_epoch": integer, # [0]
|
||||
"lease_expires_iso": string,
|
||||
"lease_obtained": string,
|
||||
"lease_obtained_epoch": integer, # [0]
|
||||
"lease_obtained_iso": string,
|
||||
"netbios_over_tcpip": boolean,
|
||||
"media_state": string,
|
||||
"extras": [
|
||||
<string>: string
|
||||
]
|
||||
}
|
||||
],
|
||||
"extras": []
|
||||
}
|
||||
|
||||
Notes:
|
||||
[0] - The epoch calculated timestamp field is naive. (i.e. based on
|
||||
the local time of the system the parser is run on)
|
||||
[1] - 'autoconfigured' under 'ipv4_address' is only providing
|
||||
indication if the ipv4 address was labeled as "Autoconfiguration
|
||||
IPv4 Address" vs "IPv4 Address". It does not infer any
|
||||
information from other fields
|
||||
[2] - Windows XP uses 'IP Address' instead of 'IPv4 Address'. Both
|
||||
values are parsed to the 'ipv4_address' object for consistency
|
||||
|
||||
Examples:
|
||||
|
||||
$ ipconfig /all | jc --ipconfig -p
|
||||
{
|
||||
"host_name": "DESKTOP-WIN11-HOME",
|
||||
"primary_dns_suffix": null,
|
||||
"node_type": "Hybrid",
|
||||
"ip_routing_enabled": false,
|
||||
"wins_proxy_enabled": false,
|
||||
"dns_suffix_search_list": [
|
||||
"localdomain"
|
||||
],
|
||||
"adapters": [
|
||||
{
|
||||
"name_long": "Ethernet adapter Ethernet",
|
||||
"name": "Ethernet",
|
||||
"type": "Ethernet",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Intel(R) I211 Gigabit Network Connection",
|
||||
"physical_address": "24-4B-FE-AB-43-C3",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Ethernet adapter Ethernet 2",
|
||||
"name": "Ethernet 2",
|
||||
"type": "Ethernet",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Realtek PCIe 2.5GbE Family Controller",
|
||||
"physical_address": "24-4B-FE-57-3D-F2",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Unknown adapter OpenVPN Data Channel Offload for NordVPN",
|
||||
"name": "OpenVPN Data Channel Offload for NordVPN",
|
||||
"type": "Unknown",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "OpenVPN Data Channel Offload",
|
||||
"physical_address": null,
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Unknown adapter Local Area Connection",
|
||||
"name": "Local Area Connection",
|
||||
"type": "Unknown",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "TAP-NordVPN Windows Adapter V9",
|
||||
"physical_address": "00-FF-4C-F4-5E-49",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Wireless LAN adapter Local Area Connection* 1",
|
||||
"name": "Local Area Connection* 1",
|
||||
"type": "Wireless LAN",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Microsoft Wi-Fi Direct Virtual Adapter",
|
||||
"physical_address": "A8-7E-EA-5A-7F-DE",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Wireless LAN adapter Local Area Connection* 2",
|
||||
"name": "Local Area Connection* 2",
|
||||
"type": "Wireless LAN",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Microsoft Wi-Fi Direct Virtual Adapter #2",
|
||||
"physical_address": "AA-7E-EA-F3-64-C3",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Ethernet adapter VMware Network Adapter VMnet1",
|
||||
"name": "VMware Network Adapter VMnet1",
|
||||
"type": "Ethernet",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "VMware Virtual Ethernet Adapter for VMnet1",
|
||||
"physical_address": "00-50-56-CC-27-73",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [
|
||||
{
|
||||
"address": "fe80::f47d:9c7f:69dc:591e",
|
||||
"prefix_length": 8,
|
||||
"status": "Preferred"
|
||||
}
|
||||
],
|
||||
"ipv4_addresses": [
|
||||
{
|
||||
"address": "192.168.181.1",
|
||||
"subnet_mask": "255.255.255.0",
|
||||
"status": "Preferred",
|
||||
"autoconfigured": false
|
||||
}
|
||||
],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": "192.168.181.254",
|
||||
"dhcpv6_iaid": "771772502",
|
||||
"dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6",
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": "2024-09-19T18:01:29",
|
||||
"lease_obtained": "2024-09-19T08:31:29",
|
||||
"netbios_over_tcpip": true,
|
||||
"media_state": null,
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Ethernet adapter VMware Network Adapter VMnet8",
|
||||
"name": "VMware Network Adapter VMnet8",
|
||||
"type": "Ethernet",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "VMware Virtual Ethernet Adapter for VMnet8",
|
||||
"physical_address": "00-50-56-C9-A3-78",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [
|
||||
{
|
||||
"address": "fe80::4551:bf0d:59dd:a4f0",
|
||||
"prefix_length": 10,
|
||||
"status": "Preferred"
|
||||
}
|
||||
],
|
||||
"ipv4_addresses": [
|
||||
{
|
||||
"address": "192.168.213.1",
|
||||
"subnet_mask": "255.255.255.0",
|
||||
"status": "Preferred",
|
||||
"autoconfigured": false
|
||||
}
|
||||
],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": "192.168.213.254",
|
||||
"dhcpv6_iaid": "788549718",
|
||||
"dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6",
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": "192.168.213.2",
|
||||
"lease_expires": "2024-09-19T18:01:29",
|
||||
"lease_obtained": "2024-09-19T08:31:29",
|
||||
"netbios_over_tcpip": true,
|
||||
"media_state": null,
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Wireless LAN adapter Wi-Fi",
|
||||
"name": "Wi-Fi",
|
||||
"type": "Wireless LAN",
|
||||
"connection_specific_dns_suffix": "localdomain",
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Intel(R) Wi-Fi 6 AX200 160MHz",
|
||||
"physical_address": "A8-7E-EA-55-26-B0",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [
|
||||
{
|
||||
"address": "fd63:cc9c:65eb:3f95:57c2:aa:10d8:db08",
|
||||
"status": "Preferred"
|
||||
}
|
||||
],
|
||||
"temporary_ipv6_addresses": [
|
||||
{
|
||||
"address": "fd63:cc9c:65eb:3f95:8928:348e:d692:b7ef",
|
||||
"status": "Preferred"
|
||||
}
|
||||
],
|
||||
"link_local_ipv6_addresses": [
|
||||
{
|
||||
"address": "fe80::4fae:1380:5a1b:8b6b",
|
||||
"prefix_length": 11,
|
||||
"status": "Preferred"
|
||||
}
|
||||
],
|
||||
"ipv4_addresses": [
|
||||
{
|
||||
"address": "192.168.1.169",
|
||||
"subnet_mask": "255.255.255.0",
|
||||
"status": "Preferred",
|
||||
"autoconfigured": false
|
||||
}
|
||||
],
|
||||
"default_gateways": [
|
||||
"192.168.1.1"
|
||||
],
|
||||
"dhcp_server": "192.168.1.1",
|
||||
"dhcpv6_iaid": "162037482",
|
||||
"dhcpv6_client_duid": "00-01-00-01-2C-CF-19-EB-24-4B-FE-5B-9B-E6",
|
||||
"dns_servers": [
|
||||
"192.168.1.1"
|
||||
],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": "2024-09-20T08:31:30",
|
||||
"lease_obtained": "2024-09-19T08:31:30",
|
||||
"netbios_over_tcpip": true,
|
||||
"media_state": null,
|
||||
"extras": []
|
||||
},
|
||||
{
|
||||
"name_long": "Ethernet adapter Bluetooth Network Connection",
|
||||
"name": "Bluetooth Network Connection",
|
||||
"type": "Ethernet",
|
||||
"connection_specific_dns_suffix": null,
|
||||
"connection_specific_dns_suffix_search_list": [],
|
||||
"description": "Bluetooth Device (Personal Area Network)",
|
||||
"physical_address": "A8-7E-EA-43-23-14",
|
||||
"dhcp_enabled": true,
|
||||
"autoconfiguration_enabled": true,
|
||||
"ipv6_addresses": [],
|
||||
"temporary_ipv6_addresses": [],
|
||||
"link_local_ipv6_addresses": [],
|
||||
"ipv4_addresses": [],
|
||||
"default_gateways": [],
|
||||
"dhcp_server": null,
|
||||
"dhcpv6_iaid": null,
|
||||
"dhcpv6_client_duid": null,
|
||||
"dns_servers": [],
|
||||
"primary_wins_server": null,
|
||||
"lease_expires": null,
|
||||
"lease_obtained": null,
|
||||
"netbios_over_tcpip": null,
|
||||
"media_state": "Media disconnected",
|
||||
"extras": []
|
||||
}
|
||||
],
|
||||
"extras": []
|
||||
}
|
||||
|
||||
<a id="jc.parsers.ipconfig.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data, raw=False, quiet=False)
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
Parsed dictionary. The raw and processed data structures are the same.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: windows
|
||||
|
||||
Source: [`jc/parsers/ipconfig.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ipconfig.py)
|
||||
|
||||
Version 1.0 by joehacksalot (joehacksalot@gmail.com)
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
jc - JSON Convert `iptables` command output parser
|
||||
|
||||
Supports `-vLn` and `--line-numbers` for all tables.
|
||||
Supports `-vLnx` and `--line-numbers` for all tables.
|
||||
|
||||
Usage (cli):
|
||||
|
||||
@@ -25,6 +25,9 @@ Schema:
|
||||
[
|
||||
{
|
||||
"chain": string,
|
||||
"default_policy": string,
|
||||
"default_packets": integer,
|
||||
"default_bytes": integer,
|
||||
"rules": [
|
||||
{
|
||||
"num" integer,
|
||||
@@ -49,6 +52,9 @@ Examples:
|
||||
[
|
||||
{
|
||||
"chain": "PREROUTING",
|
||||
"default_policy": "DROP",
|
||||
"default_packets": 0,
|
||||
"default_bytes": 0,
|
||||
"rules": [
|
||||
{
|
||||
"num": 1,
|
||||
@@ -108,6 +114,9 @@ Examples:
|
||||
[
|
||||
{
|
||||
"chain": "PREROUTING",
|
||||
"default_policy": "DROP",
|
||||
"default_packets": "0",
|
||||
"default_bytes": "0",
|
||||
"rules": [
|
||||
{
|
||||
"num": "1",
|
||||
@@ -188,4 +197,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/iptables.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/iptables.py)
|
||||
|
||||
Version 1.10 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.12 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.iw_scan"></a>
|
||||
|
||||
# jc.parsers.iw\_scan
|
||||
# jc.parsers.iw_scan
|
||||
|
||||
jc - JSON Convert `iw dev <device> scan` command output parser
|
||||
|
||||
@@ -146,4 +146,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/iw_scan.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/iw_scan.py)
|
||||
|
||||
Version 0.7 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 0.75 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -90,7 +90,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -110,4 +110,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/iwconfig.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/iwconfig.py)
|
||||
|
||||
Version 1.1 by Thomas Vincent (vrince@gmail.com)
|
||||
Version 1.2 by Thomas Vincent (vrince@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.jar_manifest"></a>
|
||||
|
||||
# jc.parsers.jar\_manifest
|
||||
# jc.parsers.jar_manifest
|
||||
|
||||
jc - JSON Convert Java `MANIFEST.MF` file parser
|
||||
|
||||
|
||||
@@ -81,4 +81,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/kv.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/kv.py)
|
||||
|
||||
Version 2.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 2.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.kv_dup"></a>
|
||||
|
||||
# jc.parsers.kv\_dup
|
||||
# jc.parsers.kv_dup
|
||||
|
||||
jc - JSON Convert `Key/Value` with duplicate key file and string parser
|
||||
|
||||
@@ -88,4 +88,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/kv_dup.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/kv_dup.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ls_s"></a>
|
||||
|
||||
# jc.parsers.ls\_s
|
||||
# jc.parsers.ls_s
|
||||
|
||||
jc - JSON Convert `ls` and `vdir` command output streaming parser
|
||||
|
||||
@@ -77,7 +77,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.lsb_release"></a>
|
||||
|
||||
# jc.parsers.lsb\_release
|
||||
# jc.parsers.lsb_release
|
||||
|
||||
jc - JSON Convert `lsb_release` command parser
|
||||
|
||||
@@ -40,7 +40,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -60,4 +60,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/lsb_release.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/lsb_release.py)
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -22,46 +22,53 @@ Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"name": string,
|
||||
"maj_min": string,
|
||||
"rm": boolean,
|
||||
"size": string,
|
||||
"ro": boolean,
|
||||
"type": string,
|
||||
"mountpoint": string,
|
||||
"kname": string,
|
||||
"fstype": string,
|
||||
"label": string,
|
||||
"uuid": string,
|
||||
"partlabel": string,
|
||||
"partuuid": string,
|
||||
"ra": integer,
|
||||
"model": string,
|
||||
"serial": string,
|
||||
"state": string,
|
||||
"owner": string,
|
||||
"group": string,
|
||||
"mode": string,
|
||||
"alignment": integer,
|
||||
"min_io": integer,
|
||||
"opt_io": integer,
|
||||
"phy_sec": integer,
|
||||
"log_sec": integer,
|
||||
"rota": boolean,
|
||||
"sched": string,
|
||||
"rq_size": integer,
|
||||
"disc_aln": integer,
|
||||
"disc_gran": string,
|
||||
"disc_max": string,
|
||||
"disc_zero": boolean,
|
||||
"wsame": string,
|
||||
"wwn": string,
|
||||
"rand": boolean,
|
||||
"pkname": string,
|
||||
"hctl": string,
|
||||
"tran": string,
|
||||
"rev": string,
|
||||
"vendor": string
|
||||
"name": string,
|
||||
"maj_min": string,
|
||||
"rm": boolean,
|
||||
"size": string,
|
||||
"size_bytes": integer
|
||||
"ro": boolean,
|
||||
"type": string,
|
||||
"mountpoint": string,
|
||||
"mountpoints": [
|
||||
string
|
||||
],
|
||||
"kname": string,
|
||||
"fstype": string,
|
||||
"label": string,
|
||||
"uuid": string,
|
||||
"partlabel": string,
|
||||
"partuuid": string,
|
||||
"ra": integer,
|
||||
"model": string,
|
||||
"serial": string,
|
||||
"state": string,
|
||||
"owner": string,
|
||||
"group": string,
|
||||
"mode": string,
|
||||
"alignment": integer,
|
||||
"min_io": integer,
|
||||
"opt_io": integer,
|
||||
"phy_sec": integer,
|
||||
"log_sec": integer,
|
||||
"rota": boolean,
|
||||
"sched": string,
|
||||
"rq_size": integer,
|
||||
"disc_aln": integer,
|
||||
"disc_gran": string,
|
||||
"disc_gran_bytes": integer,
|
||||
"disc_max": string,
|
||||
"disc_max_bytes": integer,
|
||||
"disc_zero": boolean,
|
||||
"wsame": string,
|
||||
"wsame_bytes": integer,
|
||||
"wwn": string,
|
||||
"rand": boolean,
|
||||
"pkname": string,
|
||||
"hctl": string,
|
||||
"tran": string,
|
||||
"rev": string,
|
||||
"vendor": string
|
||||
}
|
||||
]
|
||||
|
||||
@@ -74,6 +81,7 @@ Examples:
|
||||
"maj_min": "8:0",
|
||||
"rm": false,
|
||||
"size": "20G",
|
||||
"size_bytes": 20000000000,
|
||||
"ro": false,
|
||||
"type": "disk",
|
||||
"mountpoint": null
|
||||
@@ -83,6 +91,7 @@ Examples:
|
||||
"maj_min": "8:1",
|
||||
"rm": false,
|
||||
"size": "1G",
|
||||
"size_bytes": 1000000000
|
||||
"ro": false,
|
||||
"type": "part",
|
||||
"mountpoint": "/boot"
|
||||
@@ -100,6 +109,7 @@ Examples:
|
||||
"maj_min": "8:0",
|
||||
"rm": false,
|
||||
"size": "20G",
|
||||
"size_bytes": 20000000000,
|
||||
"ro": false,
|
||||
"type": "disk",
|
||||
"mountpoint": null,
|
||||
@@ -126,9 +136,12 @@ Examples:
|
||||
"rq_size": 128,
|
||||
"disc_aln": 0,
|
||||
"disc_gran": "0B",
|
||||
"disc_gran_bytes": 0,
|
||||
"disc_max": "0B",
|
||||
"disc_max_bytes": 0,
|
||||
"disc_zero": false,
|
||||
"wsame": "32M",
|
||||
"wsame_bytes": 32000000,
|
||||
"wwn": null,
|
||||
"rand": true,
|
||||
"pkname": null,
|
||||
@@ -142,6 +155,7 @@ Examples:
|
||||
"maj_min": "8:1",
|
||||
"rm": false,
|
||||
"size": "1G",
|
||||
"size_bytes": 1000000000
|
||||
"ro": false,
|
||||
"type": "part",
|
||||
"mountpoint": "/boot",
|
||||
@@ -168,9 +182,12 @@ Examples:
|
||||
"rq_size": 128,
|
||||
"disc_aln": 0,
|
||||
"disc_gran": "0B",
|
||||
"disc_gran_bytes": 0,
|
||||
"disc_max": "0B",
|
||||
"disc_max_bytes": 0,
|
||||
"disc_zero": false,
|
||||
"wsame": "32M",
|
||||
"wsame_bytes": 32000000,
|
||||
"wwn": null,
|
||||
"rand": true,
|
||||
"pkname": "sda",
|
||||
@@ -192,6 +209,7 @@ Examples:
|
||||
"maj_min": "8:0",
|
||||
"rm": "0",
|
||||
"size": "20G",
|
||||
"size_bytes": 20000000000,
|
||||
"ro": "0",
|
||||
"type": "disk",
|
||||
"mountpoint": null,
|
||||
@@ -218,9 +236,12 @@ Examples:
|
||||
"rq_size": "128",
|
||||
"disc_aln": "0",
|
||||
"disc_gran": "0B",
|
||||
"disc_gran_bytes": 0,
|
||||
"disc_max": "0B",
|
||||
"disc_max_bytes": 0,
|
||||
"disc_zero": "0",
|
||||
"wsame": "32M",
|
||||
"wsame_bytes": 32000000,
|
||||
"wwn": null,
|
||||
"rand": "1",
|
||||
"pkname": null,
|
||||
@@ -234,6 +255,7 @@ Examples:
|
||||
"maj_min": "8:1",
|
||||
"rm": "0",
|
||||
"size": "1G",
|
||||
"size_bytes": 1000000000
|
||||
"ro": "0",
|
||||
"type": "part",
|
||||
"mountpoint": "/boot",
|
||||
@@ -260,9 +282,12 @@ Examples:
|
||||
"rq_size": "128",
|
||||
"disc_aln": "0",
|
||||
"disc_gran": "0B",
|
||||
"disc_gran_bytes": 0,
|
||||
"disc_max": "0B",
|
||||
"disc_max_bytes": 0,
|
||||
"disc_zero": "0",
|
||||
"wsame": "32M",
|
||||
"wsame_bytes": 32000000,
|
||||
"wwn": null,
|
||||
"rand": "1",
|
||||
"pkname": "sda",
|
||||
@@ -299,4 +324,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/lsblk.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/lsblk.py)
|
||||
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.10 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -53,7 +53,6 @@ Schema:
|
||||
"sdevice_id_int": integer,
|
||||
"rev": string,
|
||||
"physlot": string,
|
||||
"physlot_int": integer,
|
||||
"progif": string,
|
||||
"progif_int": integer
|
||||
}
|
||||
@@ -89,7 +88,6 @@ Examples:
|
||||
"sdevice_id": "07e0",
|
||||
"sdevice_id_int": 2016,
|
||||
"physlot": "37",
|
||||
"physlot_int": 55,
|
||||
"progif": "01",
|
||||
"progif_int": 1
|
||||
},
|
||||
@@ -127,7 +125,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -147,4 +145,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/lspci.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/lspci.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -100,4 +100,4 @@ Compatibility: linux, darwin, freebsd, aix
|
||||
|
||||
Source: [`jc/parsers/mount.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/mount.py)
|
||||
|
||||
Version 1.9 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.11 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.mpstat_s"></a>
|
||||
|
||||
# jc.parsers.mpstat\_s
|
||||
# jc.parsers.mpstat_s
|
||||
|
||||
jc - JSON Convert `mpstat` command output streaming parser
|
||||
|
||||
@@ -100,7 +100,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
|
||||
101
docs/parsers/needrestart.md
Normal file
101
docs/parsers/needrestart.md
Normal file
@@ -0,0 +1,101 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.needrestart"></a>
|
||||
|
||||
# jc.parsers.needrestart
|
||||
|
||||
jc - JSON Convert `needrestart -b` command output parser
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ needrestart -b | jc --needrestart
|
||||
|
||||
or
|
||||
|
||||
$ jc needrestart -b
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('needrestart', needrestart_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
{
|
||||
"version": string,
|
||||
"running_kernel_version": string,
|
||||
"expected_kernel_version": string,
|
||||
"kernel_status": integer,
|
||||
"container": string,
|
||||
"session": [
|
||||
string
|
||||
],
|
||||
"service": [
|
||||
string
|
||||
],
|
||||
"pid": [
|
||||
string
|
||||
]
|
||||
}
|
||||
|
||||
Examples:
|
||||
|
||||
$ needrestart -b | jc --needrestart -p
|
||||
{
|
||||
"version": "2.1",
|
||||
"running_kernel_version": "3.19.3-tl1+",
|
||||
"expected_kernel_version": "3.19.3-tl1+",
|
||||
"kernel_status": 1,
|
||||
"container": "LXC web1",
|
||||
"session": [
|
||||
"metabase @ user manager service",
|
||||
"root @ session #28017"
|
||||
],
|
||||
"service": [
|
||||
"systemd-journald.service",
|
||||
"systemd-machined.service"
|
||||
]
|
||||
}
|
||||
|
||||
$ needrestart -b | jc --needrestart -p -r
|
||||
{
|
||||
"needrestart_ver": "2.1",
|
||||
"needrestart_kcur": "3.19.3-tl1+",
|
||||
"needrestart_kexp": "3.19.3-tl1+",
|
||||
"needrestart_ksta": "1",
|
||||
"needrestart_cont": "LXC web1",
|
||||
"needrestart_sess": [
|
||||
"metabase @ user manager service",
|
||||
"root @ session #28017"
|
||||
],
|
||||
"needrestart_svc": [
|
||||
"systemd-journald.service",
|
||||
"systemd-machined.service"
|
||||
]
|
||||
}
|
||||
|
||||
<a id="jc.parsers.needrestart.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/needrestart.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/needrestart.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -380,4 +380,4 @@ Compatibility: linux, darwin, freebsd, win32
|
||||
|
||||
Source: [`jc/parsers/netstat.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/netstat.py)
|
||||
|
||||
Version 1.15 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.16 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -41,6 +41,7 @@ These are documented below.
|
||||
[
|
||||
{
|
||||
"<key>": string/integer/float, # [0]
|
||||
"team_config": object,
|
||||
"dhcp4_option_x": {
|
||||
"name": string,
|
||||
"value": string/integer/float,
|
||||
@@ -170,4 +171,4 @@ Compatibility: linux
|
||||
|
||||
Source: [`jc/parsers/nmcli.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/nmcli.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.nsd_control"></a>
|
||||
|
||||
# jc.parsers.nsd\_control
|
||||
# jc.parsers.nsd_control
|
||||
|
||||
jc - JSON Convert `nsd-control` command output parser
|
||||
|
||||
@@ -22,20 +22,24 @@ Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"version": string,
|
||||
"verbosity": integer,
|
||||
"ratelimit": integer
|
||||
"version": string,
|
||||
"verbosity": integer,
|
||||
"ratelimit": integer
|
||||
}
|
||||
]
|
||||
|
||||
[
|
||||
{
|
||||
"zone": string
|
||||
"zone": string
|
||||
"status": {
|
||||
"state": string,
|
||||
"served-serial": string,
|
||||
"commit-serial": string,
|
||||
"wait": string
|
||||
"state": string,
|
||||
"pattern": string, # Additional
|
||||
"catalog-member-id": string, # Additional
|
||||
"served-serial": string,
|
||||
"commit-serial": string,
|
||||
"notified-serial": string, # Conditional
|
||||
"wait": string,
|
||||
"transfer": string # Conditional
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -89,4 +93,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/nsd_control.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/nsd_control.py)
|
||||
|
||||
Version 1.1 by Pettai (pettai@sunet.se)
|
||||
Version 1.2 by Pettai (pettai@sunet.se)
|
||||
|
||||
@@ -157,7 +157,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.os_prober"></a>
|
||||
|
||||
# jc.parsers.os\_prober
|
||||
# jc.parsers.os_prober
|
||||
|
||||
jc - JSON Convert `os-prober` command output parser
|
||||
|
||||
@@ -45,7 +45,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.os_release"></a>
|
||||
|
||||
# jc.parsers.os\_release
|
||||
# jc.parsers.os_release
|
||||
|
||||
jc - JSON Convert `/etc/os-release` file parser
|
||||
|
||||
@@ -65,7 +65,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -85,4 +85,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/os_release.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/os_release.py)
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
208
docs/parsers/pacman.md
Normal file
208
docs/parsers/pacman.md
Normal file
@@ -0,0 +1,208 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pacman"></a>
|
||||
|
||||
# jc.parsers.pacman
|
||||
|
||||
jc - JSON Convert `pacman` command output parser
|
||||
|
||||
Supports the following `pacman` arguments:
|
||||
|
||||
- `-Si`
|
||||
- `-Sii`
|
||||
- `-Qi`
|
||||
- `-Qii`
|
||||
|
||||
The `*_epoch` calculated timestamp fields are naive. (i.e. based on the
|
||||
local time of the system the parser is run on)
|
||||
|
||||
Usage (cli):
|
||||
|
||||
$ pacman -Si <package> | jc --pacman
|
||||
|
||||
or
|
||||
|
||||
$ jc pacman -Si <package>
|
||||
|
||||
Usage (module):
|
||||
|
||||
import jc
|
||||
result = jc.parse('pacman', pacman_command_output)
|
||||
|
||||
Schema:
|
||||
|
||||
[
|
||||
{
|
||||
"repository": string,
|
||||
"name": string,
|
||||
"version": string,
|
||||
"description": string,
|
||||
"architecture": string,
|
||||
"url": string,
|
||||
"licenses": [
|
||||
string
|
||||
],
|
||||
"groups": [
|
||||
string
|
||||
],
|
||||
"provides": [
|
||||
string
|
||||
],
|
||||
"depends_on": [
|
||||
string
|
||||
],
|
||||
"optional_deps": [
|
||||
{
|
||||
"name": string,
|
||||
"description": string
|
||||
}
|
||||
],
|
||||
"optional_for": [
|
||||
string
|
||||
],
|
||||
"conflicts_with": [
|
||||
string
|
||||
],
|
||||
"replaces": [
|
||||
string
|
||||
],
|
||||
"download_size": string,
|
||||
"download_size_bytes": integer [0]
|
||||
"installed_size": string,
|
||||
"installed_size_bytes": integer, [0]
|
||||
"packager": string,
|
||||
"build_date": string,
|
||||
"build_date_epoch": integer, [0]
|
||||
"install_date": string,
|
||||
"install_date_epoch": integer, [0]
|
||||
"validated_by": [
|
||||
string
|
||||
],
|
||||
"backup_files": [
|
||||
string
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
[0] Field exists if conversion successful
|
||||
|
||||
Examples:
|
||||
|
||||
$ pacman -qii zstd | jc --pacman -p
|
||||
[
|
||||
{
|
||||
"name": "zstd",
|
||||
"version": "1.5.6-1",
|
||||
"description": "Zstandard - Fast real-time compression algorithm",
|
||||
"architecture": "x86_64",
|
||||
"url": "https://facebook.github.io/zstd/",
|
||||
"licenses": [
|
||||
"BSD-3-Clause",
|
||||
"GPL-2.0-only"
|
||||
],
|
||||
"groups": [],
|
||||
"provides": [
|
||||
"libzstd.so=1-64"
|
||||
],
|
||||
"depends_on": [
|
||||
"glibc",
|
||||
"gcc-libs",
|
||||
"zlib",
|
||||
"xz",
|
||||
"lz4"
|
||||
],
|
||||
"required_by": [
|
||||
"android-tools",
|
||||
"appstream",
|
||||
...
|
||||
"tiled",
|
||||
"vulkan-radeon",
|
||||
"wireshark-cli"
|
||||
],
|
||||
"optional_for": [
|
||||
"xarchiver"
|
||||
],
|
||||
"conflicts_with": [],
|
||||
"replaces": [],
|
||||
"installed_size": "1527.00 KiB",
|
||||
"installed_size_bytes": 1563648,
|
||||
"packager": "Levente Polyak <anthraxx@archlinux.org>",
|
||||
"build_date": "Sat 11 May 2024 06:14:19 AM +08",
|
||||
"build_date_epoch": 1715433259,
|
||||
"install_date": "Fri 24 May 2024 09:50:31 AM +08",
|
||||
"install_date_epoch": 1715663342,
|
||||
"install_reason": "Installed as a dependency for another package",
|
||||
"install_script": "No",
|
||||
"validated_by": [
|
||||
"Signature"
|
||||
],
|
||||
"extended_data": "pkgtype=pkg"
|
||||
}
|
||||
]
|
||||
|
||||
$ pacman -qii zstd | jc --pacman -p -r
|
||||
[
|
||||
{
|
||||
"name": "zstd",
|
||||
"version": "1.5.6-1",
|
||||
"description": "Zstandard - Fast real-time compression algorithm",
|
||||
"architecture": "x86_64",
|
||||
"url": "https://facebook.github.io/zstd/",
|
||||
"licenses": "BSD-3-Clause GPL-2.0-only",
|
||||
"groups": null,
|
||||
"provides": "libzstd.so=1-64",
|
||||
"depends_on": "glibc gcc-libs zlib xz lz4",
|
||||
"required_by": [
|
||||
"android-tools appstream avr-gcc binutils blender blosc",
|
||||
"boost-libs btrfs-progs cloudflare-warp-bin comgr curl",
|
||||
"dolphin-emu file flatpak gcc gdal gnutls karchive",
|
||||
"karchive5 kmod lib32-zstd libarchive libelf libtiff",
|
||||
"libva-mesa-driver libxmlb libzip lld llvm-libs mariadb-libs",
|
||||
"mesa mesa-vdpau minizip-ng mkinitcpio mold netcdf",
|
||||
"opencl-clover-mesa opencl-rusticl-mesa openucx postgresql",
|
||||
"postgresql-libs ppsspp qemu-img qemu-system-riscv",
|
||||
"qemu-system-x86 qgis qt6-base qt6-tools rsync rustup",
|
||||
"squashfs-tools squashfuse systemd-libs tiled vulkan-radeon",
|
||||
"wireshark-cli"
|
||||
],
|
||||
"optional_for": "xarchiver",
|
||||
"conflicts_with": null,
|
||||
"replaces": null,
|
||||
"installed_size": "1527.00 KiB",
|
||||
"packager": "Levente Polyak <anthraxx@archlinux.org>",
|
||||
"build_date": "Sat 11 May 2024 06:14:19 AM +08",
|
||||
"install_date": "Fri 24 May 2024 09:50:31 AM +08",
|
||||
"install_reason": "Installed as a dependency for another package",
|
||||
"install_script": "No",
|
||||
"validated_by": "Signature",
|
||||
"extended_data": "pkgtype=pkg"
|
||||
}
|
||||
]
|
||||
|
||||
<a id="jc.parsers.pacman.parse"></a>
|
||||
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
List of Dictionaries. Raw or processed structured data.
|
||||
|
||||
### Parser Information
|
||||
Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/pacman.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pacman.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.path_list"></a>
|
||||
|
||||
# jc.parsers.path\_list
|
||||
# jc.parsers.path_list
|
||||
|
||||
jc - JSON Convert POSIX path list string parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pci_ids"></a>
|
||||
|
||||
# jc.parsers.pci\_ids
|
||||
# jc.parsers.pci_ids
|
||||
|
||||
jc - JSON Convert `pci.ids` file parser
|
||||
|
||||
@@ -78,7 +78,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -98,4 +98,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/pci_ids.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pci_ids.py)
|
||||
|
||||
Version 1.0 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -54,7 +54,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pidstat_s"></a>
|
||||
|
||||
# jc.parsers.pidstat\_s
|
||||
# jc.parsers.pidstat_s
|
||||
|
||||
jc - JSON Convert `pidstat -H` command output streaming parser
|
||||
|
||||
@@ -86,7 +86,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data: Iterable[str],
|
||||
raw: bool = False,
|
||||
quiet: bool = False,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.ping_s"></a>
|
||||
|
||||
# jc.parsers.ping\_s
|
||||
# jc.parsers.ping_s
|
||||
|
||||
jc - JSON Convert `ping` command output streaming parser
|
||||
|
||||
@@ -86,7 +86,6 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
@add_jc_meta
|
||||
def parse(data, raw=False, quiet=False, ignore_exceptions=False)
|
||||
```
|
||||
|
||||
@@ -110,4 +109,4 @@ Compatibility: linux, darwin, freebsd
|
||||
|
||||
Source: [`jc/parsers/ping_s.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/ping_s.py)
|
||||
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.6 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pip_list"></a>
|
||||
|
||||
# jc.parsers.pip\_list
|
||||
# jc.parsers.pip_list
|
||||
|
||||
jc - JSON Convert `pip-list` command output parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pip_show"></a>
|
||||
|
||||
# jc.parsers.pip\_show
|
||||
# jc.parsers.pip_show
|
||||
|
||||
jc - JSON Convert `pip-show` command output parser
|
||||
|
||||
@@ -90,4 +90,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/pip_show.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pip_show.py)
|
||||
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.5 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pkg_index_apk"></a>
|
||||
|
||||
# jc.parsers.pkg\_index\_apk
|
||||
# jc.parsers.pkg_index_apk
|
||||
|
||||
jc - JSON Convert Alpine Linux Package Index files
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.pkg_index_deb"></a>
|
||||
|
||||
# jc.parsers.pkg\_index\_deb
|
||||
# jc.parsers.pkg_index_deb
|
||||
|
||||
jc - JSON Convert Debian Package Index file parser
|
||||
|
||||
@@ -27,9 +27,15 @@ Schema:
|
||||
"maintainer": string,
|
||||
"description": string,
|
||||
"homepage": string,
|
||||
"depends": string,
|
||||
"conflicts": string,
|
||||
"replaces": string,
|
||||
"depends": [
|
||||
string
|
||||
],
|
||||
"conflicts": [
|
||||
string
|
||||
],
|
||||
"replaces": [
|
||||
string
|
||||
],
|
||||
"vcs_git": string,
|
||||
"sha256": string,
|
||||
"size": integer,
|
||||
@@ -43,35 +49,44 @@ Examples:
|
||||
$ cat Packages | jc --pkg-index-deb
|
||||
[
|
||||
{
|
||||
"package": "aspnetcore-runtime-2.1",
|
||||
"version": "2.1.22-1",
|
||||
"package": "dotnet-host",
|
||||
"version": "3.1.16-1",
|
||||
"architecture": "amd64",
|
||||
"section": "libs",
|
||||
"priority": "standard",
|
||||
"installed_size": 146,
|
||||
"maintainer": ".NET Core Team <dotnetpackages@dotnetfoundation.org>",
|
||||
"description": "Microsoft .NET Core Host - 3.1.16",
|
||||
"homepage": "https://dot.net/core",
|
||||
"conflicts": [
|
||||
"dotnet",
|
||||
"dotnet-nightly"
|
||||
],
|
||||
"depends": [
|
||||
"libgcc1",
|
||||
"libstdc++6",
|
||||
"libc6"
|
||||
],
|
||||
"sha256": "2557da13447d61382f255eb751ba29cc1a8220899c1e3e640a7bb3d2a0c1d297",
|
||||
"size": 32594,
|
||||
"filename": "pool/main/d/dotnet-host/dotnet-host-3.1.16-x64.deb"
|
||||
},
|
||||
{
|
||||
"package": "aspnetcore-runtime-5.0",
|
||||
"version": "5.0.10-1",
|
||||
"architecture": "amd64",
|
||||
"section": "devel",
|
||||
"priority": "standard",
|
||||
"installed_size": 71081,
|
||||
"installed_size": 18551,
|
||||
"maintainer": "Microsoft <nugetaspnet@microsoft.com>",
|
||||
"description": "Microsoft ASP.NET Core 2.1.22 Shared Framework",
|
||||
"homepage": "https://www.asp.net/",
|
||||
"depends": "libc6 (>= 2.14), dotnet-runtime-2.1 (>= 2.1.22)",
|
||||
"sha256": "48d4e78a7ceff34105411172f4c3e91a0359b3929d84d26a493...",
|
||||
"size": 21937036,
|
||||
"filename": "pool/main/a/aspnetcore-runtime-2.1/aspnetcore-run..."
|
||||
},
|
||||
{
|
||||
"package": "azure-functions-core-tools-4",
|
||||
"version": "4.0.4590-1",
|
||||
"architecture": "amd64",
|
||||
"section": "devel",
|
||||
"priority": "optional",
|
||||
"maintainer": "Ahmed ElSayed <ahmels@microsoft.com>",
|
||||
"description": "Azure Function Core Tools v4",
|
||||
"homepage": "https://docs.microsoft.com/en-us/azure/azure-func...",
|
||||
"conflicts": "azure-functions-core-tools-2, azure-functions-co...",
|
||||
"replaces": "azure-functions-core-tools-2, azure-functions-cor...",
|
||||
"vcs_git": "https://github.com/Azure/azure-functions-core-tool...",
|
||||
"sha256": "a2a4f99d6d98ba0a46832570285552f2a93bab06cebbda2afc7...",
|
||||
"size": 124417844,
|
||||
"filename": "pool/main/a/azure-functions-core-tools-4/azure-fu..."
|
||||
"description": "Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub (https://github.com/dotnet/aspnetcore). We happily accept issues and PRs.",
|
||||
"homepage": "https://asp.net",
|
||||
"depends": [
|
||||
"dotnet-runtime-5.0 (>= 5.0.10)"
|
||||
],
|
||||
"sha256": "1d9869f862cb4e9c46b245a343d8e39fbbc84d9f8ab9ef357c4643da20805ad3",
|
||||
"size": 6084188,
|
||||
"filename": "pool/main/a/aspnetcore-runtime-5.0/aspnetcore-runtime-5.0.10-x64.deb"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -117,7 +132,7 @@ Examples:
|
||||
```python
|
||||
def parse(data: str,
|
||||
raw: bool = False,
|
||||
quiet: bool = False) -> List[JSONDictType]
|
||||
quiet: bool = False) -> List[Dict[str, Any]]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
@@ -137,4 +152,4 @@ Compatibility: linux, darwin, cygwin, win32, aix, freebsd
|
||||
|
||||
Source: [`jc/parsers/pkg_index_deb.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/pkg_index_deb.py)
|
||||
|
||||
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.2 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -31,7 +31,7 @@ or
|
||||
|
||||
or
|
||||
|
||||
$ cat /proc/meminfo | jc --proc-memifno
|
||||
$ cat /proc/meminfo | jc --proc-meminfo
|
||||
|
||||
Usage (module):
|
||||
|
||||
@@ -52,7 +52,7 @@ Specific Proc file parser names can be found with `jc -hh` or `jc -a`.
|
||||
|
||||
Schemas can also be found online at:
|
||||
|
||||
https://kellyjonbrazil.github.io/jc/docs/parsers/proc_<name>
|
||||
https://kellyjonbrazil.github.io/jc/docs/parsers/proc_<name>
|
||||
|
||||
For example:
|
||||
|
||||
@@ -151,4 +151,4 @@ Source: [`jc/parsers/proc.py`](https://github.com/kellyjonbrazil/jc/blob/master/
|
||||
|
||||
This parser can be used with the `--slurp` command-line option.
|
||||
|
||||
Version 1.3 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
Version 1.4 by Kelly Brazil (kellyjonbrazil@gmail.com)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_buddyinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_buddyinfo
|
||||
# jc.parsers.proc_buddyinfo
|
||||
|
||||
jc - JSON Convert `/proc/buddyinfo` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_cmdline"></a>
|
||||
|
||||
# jc.parsers.proc\_cmdline
|
||||
# jc.parsers.proc_cmdline
|
||||
|
||||
jc - JSON Convert `/proc/cmdline` file parser
|
||||
|
||||
@@ -71,7 +71,7 @@ Examples:
|
||||
### parse
|
||||
|
||||
```python
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> JSONDictType
|
||||
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict[str, Any]
|
||||
```
|
||||
|
||||
Main text parsing function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_consoles"></a>
|
||||
|
||||
# jc.parsers.proc\_consoles
|
||||
# jc.parsers.proc_consoles
|
||||
|
||||
jc - JSON Convert `/proc/consoles` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_cpuinfo"></a>
|
||||
|
||||
# jc.parsers.proc\_cpuinfo
|
||||
# jc.parsers.proc_cpuinfo
|
||||
|
||||
jc - JSON Convert `/proc/cpuinfo` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_crypto"></a>
|
||||
|
||||
# jc.parsers.proc\_crypto
|
||||
# jc.parsers.proc_crypto
|
||||
|
||||
jc - JSON Convert `/proc/crypto` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_devices"></a>
|
||||
|
||||
# jc.parsers.proc\_devices
|
||||
# jc.parsers.proc_devices
|
||||
|
||||
jc - JSON Convert `/proc/devices` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_diskstats"></a>
|
||||
|
||||
# jc.parsers.proc\_diskstats
|
||||
# jc.parsers.proc_diskstats
|
||||
|
||||
jc - JSON Convert `/proc/diskstats` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_driver_rtc"></a>
|
||||
|
||||
# jc.parsers.proc\_driver\_rtc
|
||||
# jc.parsers.proc_driver_rtc
|
||||
|
||||
jc - JSON Convert `/proc/driver/rtc` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_filesystems"></a>
|
||||
|
||||
# jc.parsers.proc\_filesystems
|
||||
# jc.parsers.proc_filesystems
|
||||
|
||||
jc - JSON Convert `/proc/filesystems` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_interrupts"></a>
|
||||
|
||||
# jc.parsers.proc\_interrupts
|
||||
# jc.parsers.proc_interrupts
|
||||
|
||||
jc - JSON Convert `/proc/interrupts` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_iomem"></a>
|
||||
|
||||
# jc.parsers.proc\_iomem
|
||||
# jc.parsers.proc_iomem
|
||||
|
||||
jc - JSON Convert `/proc/iomem` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_ioports"></a>
|
||||
|
||||
# jc.parsers.proc\_ioports
|
||||
# jc.parsers.proc_ioports
|
||||
|
||||
jc - JSON Convert `/proc/ioports` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_loadavg"></a>
|
||||
|
||||
# jc.parsers.proc\_loadavg
|
||||
# jc.parsers.proc_loadavg
|
||||
|
||||
jc - JSON Convert `/proc/loadavg` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_locks"></a>
|
||||
|
||||
# jc.parsers.proc\_locks
|
||||
# jc.parsers.proc_locks
|
||||
|
||||
jc - JSON Convert `/proc/locks` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_meminfo"></a>
|
||||
|
||||
# jc.parsers.proc\_meminfo
|
||||
# jc.parsers.proc_meminfo
|
||||
|
||||
jc - JSON Convert `/proc/meminfo` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_modules"></a>
|
||||
|
||||
# jc.parsers.proc\_modules
|
||||
# jc.parsers.proc_modules
|
||||
|
||||
jc - JSON Convert `/proc/modules` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_mtrr"></a>
|
||||
|
||||
# jc.parsers.proc\_mtrr
|
||||
# jc.parsers.proc_mtrr
|
||||
|
||||
jc - JSON Convert `/proc/mtrr` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_arp"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_arp
|
||||
# jc.parsers.proc_net_arp
|
||||
|
||||
jc - JSON Convert `/proc/net/arp` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_dev"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_dev
|
||||
# jc.parsers.proc_net_dev
|
||||
|
||||
jc - JSON Convert `/proc/net/dev` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_dev_mcast"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_dev\_mcast
|
||||
# jc.parsers.proc_net_dev_mcast
|
||||
|
||||
jc - JSON Convert `/proc/net/dev_mcast` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_if_inet6"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_if\_inet6
|
||||
# jc.parsers.proc_net_if_inet6
|
||||
|
||||
jc - JSON Convert `/proc/net/if_inet6` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_igmp"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_igmp
|
||||
# jc.parsers.proc_net_igmp
|
||||
|
||||
jc - JSON Convert `/proc/net/igmp` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_igmp6"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_igmp6
|
||||
# jc.parsers.proc_net_igmp6
|
||||
|
||||
jc - JSON Convert `/proc/net/igmp6` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_ipv6_route"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_ipv6\_route
|
||||
# jc.parsers.proc_net_ipv6_route
|
||||
|
||||
jc - JSON Convert `/proc/net/ipv6_route` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_netlink"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_netlink
|
||||
# jc.parsers.proc_net_netlink
|
||||
|
||||
jc - JSON Convert `/proc/net/netlink` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_netstat"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_netstat
|
||||
# jc.parsers.proc_net_netstat
|
||||
|
||||
jc - JSON Convert `/proc/net/netstat` file parser
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[Home](https://kellyjonbrazil.github.io/jc/)
|
||||
<a id="jc.parsers.proc_net_packet"></a>
|
||||
|
||||
# jc.parsers.proc\_net\_packet
|
||||
# jc.parsers.proc_net_packet
|
||||
|
||||
jc - JSON Convert `/proc/net/packet` file parser
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user