1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-19 00:17:51 +02:00

change name to JSON Convert

This commit is contained in:
Kelly Brazil
2022-03-04 13:27:39 -08:00
parent 9a3602e70b
commit cb2dfeac8d
199 changed files with 334 additions and 326 deletions

View File

@ -1,8 +1,6 @@
![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master) ![Tests](https://github.com/kellyjonbrazil/jc/workflows/Tests/badge.svg?branch=master)
![Pypi](https://img.shields.io/pypi/v/jc.svg) ![Pypi](https://img.shields.io/pypi/v/jc.svg)
> `jc` was recently featured in the [Console Open Source Newsletter](https://console.substack.com/p/console-89)
> Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers > Check out the `jc` Python [package documentation](https://github.com/kellyjonbrazil/jc/tree/master/docs) for developers
> Try the `jc` [web demo](https://jc-web-demo.herokuapp.com/) > Try the `jc` [web demo](https://jc-web-demo.herokuapp.com/)
@ -13,7 +11,7 @@ Ansible filter plugin in the `community.general` collection. See this
for an example. for an example.
# JC # JC
JSON CLI output utility JSON Convert
`jc` JSONifies the output of many CLI tools and file-types for easier parsing in `jc` JSONifies the output of many CLI tools and file-types for easier parsing in
scripts. See the [**Parsers**](#parsers) section for supported commands and scripts. See the [**Parsers**](#parsers) section for supported commands and

View File

@ -18,7 +18,7 @@ readme_config=$(cat <<'EOF'
"Class": 3, "Class": 3,
"Method": 3, "Method": 3,
"Function": 3, "Function": 3,
"Data": 3 "Variable": 3
} }
} }
} }
@ -43,7 +43,7 @@ toc_config=$(cat <<'EOF'
"Class": 3, "Class": 3,
"Method": 3, "Method": 3,
"Function": 3, "Function": 3,
"Data": 3 "Variable": 3
} }
} }
} }
@ -68,7 +68,7 @@ parser_config=$(cat <<'EOF'
"Class": 3, "Class": 3,
"Method": 3, "Method": 3,
"Function": 3, "Function": 3,
"Data": 3 "Variable": 3
} }
} }
} }

View File

@ -14,15 +14,20 @@
# jc.lib # jc.lib
jc - JSON CLI output utility jc - JSON Convert
JC lib module JC lib module
<a id="jc.lib.parse"></a> <a id="jc.lib.parse"></a>
### parse #### parse
```python ```python
def parse(parser_mod_name: str, data: Union[str, Iterable[str]], quiet: bool = False, raw: bool = False, ignore_exceptions: bool = None, **kwargs) -> Union[Dict, List[Dict], Iterator[Dict]] def parse(parser_mod_name: str,
data: Union[str, Iterable[str]],
quiet: bool = False,
raw: bool = False,
ignore_exceptions: bool = None,
**kwargs) -> Union[Dict, List[Dict], Iterator[Dict]]
``` ```
Parse the string data using the supplied parser module. Parse the string data using the supplied parser module.
@ -81,7 +86,7 @@ Returns:
<a id="jc.lib.parser_mod_list"></a> <a id="jc.lib.parser_mod_list"></a>
### parser\_mod\_list #### parser\_mod\_list
```python ```python
def parser_mod_list() -> List[str] def parser_mod_list() -> List[str]
@ -91,7 +96,7 @@ Returns a list of all available parser module names.
<a id="jc.lib.plugin_parser_mod_list"></a> <a id="jc.lib.plugin_parser_mod_list"></a>
### plugin\_parser\_mod\_list #### plugin\_parser\_mod\_list
```python ```python
def plugin_parser_mod_list() -> List[str] def plugin_parser_mod_list() -> List[str]
@ -102,7 +107,7 @@ subset of `parser_mod_list()`.
<a id="jc.lib.standard_parser_mod_list"></a> <a id="jc.lib.standard_parser_mod_list"></a>
### standard\_parser\_mod\_list #### standard\_parser\_mod\_list
```python ```python
def standard_parser_mod_list() -> List[str] def standard_parser_mod_list() -> List[str]
@ -114,7 +119,7 @@ parsers.
<a id="jc.lib.streaming_parser_mod_list"></a> <a id="jc.lib.streaming_parser_mod_list"></a>
### streaming\_parser\_mod\_list #### streaming\_parser\_mod\_list
```python ```python
def streaming_parser_mod_list() -> List[str] def streaming_parser_mod_list() -> List[str]
@ -125,7 +130,7 @@ subset of `parser_mod_list()`.
<a id="jc.lib.parser_info"></a> <a id="jc.lib.parser_info"></a>
### parser\_info #### parser\_info
```python ```python
def parser_info(parser_mod_name: str) -> Dict def parser_info(parser_mod_name: str) -> Dict
@ -138,7 +143,7 @@ This function will accept **module_name**, **cli-name**, and
<a id="jc.lib.all_parser_info"></a> <a id="jc.lib.all_parser_info"></a>
### all\_parser\_info #### all\_parser\_info
```python ```python
def all_parser_info() -> List[Dict] def all_parser_info() -> List[Dict]
@ -148,7 +153,7 @@ Returns a list of dictionaries that includes metadata for all modules.
<a id="jc.lib.get_help"></a> <a id="jc.lib.get_help"></a>
### get\_help #### get\_help
```python ```python
def get_help(parser_mod_name: str) -> None def get_help(parser_mod_name: str) -> None

View File

@ -3,7 +3,7 @@
# jc.parsers.acpi # jc.parsers.acpi
jc - JSON CLI output utility `acpi` command output parser jc - JSON Convert `acpi` command output parser
Usage (cli): Usage (cli):
@ -234,7 +234,7 @@ Examples:
<a id="jc.parsers.acpi.parse"></a> <a id="jc.parsers.acpi.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.airport # jc.parsers.airport
jc - JSON CLI output utility `airport -I` command output parser jc - JSON Convert `airport -I` command output parser
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`. The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
@ -87,7 +87,7 @@ Examples:
<a id="jc.parsers.airport.parse"></a> <a id="jc.parsers.airport.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.airport\_s # jc.parsers.airport\_s
jc - JSON CLI output utility `airport -s` command output parser jc - JSON Convert `airport -s` command output parser
The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`. The `airport` program can be found at `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport`.
@ -115,7 +115,7 @@ Examples:
<a id="jc.parsers.airport_s.parse"></a> <a id="jc.parsers.airport_s.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.arp # jc.parsers.arp
jc - JSON CLI output utility `arp` command output parser jc - JSON Convert `arp` command output parser
Supports `arp` and `arp -a` output. Supports `arp` and `arp -a` output.
@ -124,7 +124,7 @@ Examples:
<a id="jc.parsers.arp.parse"></a> <a id="jc.parsers.arp.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.blkid # jc.parsers.blkid
jc - JSON CLI output utility `blkid` command output parser jc - JSON Convert `blkid` command output parser
Usage (cli): Usage (cli):
@ -127,7 +127,7 @@ Examples:
<a id="jc.parsers.blkid.parse"></a> <a id="jc.parsers.blkid.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.cksum # jc.parsers.cksum
jc - JSON CLI output utility `cksum` command output parser jc - JSON Convert `cksum` command output parser
This parser works with the following checksum calculation utilities: This parser works with the following checksum calculation utilities:
- `sum` - `sum`
@ -61,7 +61,7 @@ Examples:
<a id="jc.parsers.cksum.parse"></a> <a id="jc.parsers.cksum.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.crontab # jc.parsers.crontab
jc - JSON CLI output utility `crontab -l` command output and crontab jc - JSON Convert `crontab -l` command output and crontab
file parser file parser
Supports `crontab -l` command output and crontab files. Supports `crontab -l` command output and crontab files.
@ -180,7 +180,7 @@ Examples:
<a id="jc.parsers.crontab.parse"></a> <a id="jc.parsers.crontab.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.crontab\_u # jc.parsers.crontab\_u
jc - JSON CLI output utility `crontab -l` command output and crontab jc - JSON Convert `crontab -l` command output and crontab
file parser file parser
This version of the `crontab -l` parser supports output that contains user This version of the `crontab -l` parser supports output that contains user
@ -177,7 +177,7 @@ Examples:
<a id="jc.parsers.crontab_u.parse"></a> <a id="jc.parsers.crontab_u.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.csv # jc.parsers.csv
jc - JSON CLI output utility `csv` file parser jc - JSON Convert `csv` file parser
The `csv` parser will attempt to automatically detect the delimiter The `csv` parser will attempt to automatically detect the delimiter
character. If the delimiter cannot be detected it will default to comma. character. If the delimiter cannot be detected it will default to comma.
@ -84,7 +84,7 @@ Examples:
<a id="jc.parsers.csv.parse"></a> <a id="jc.parsers.csv.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.csv\_s # jc.parsers.csv\_s
jc - JSON CLI output utility `csv` file streaming parser jc - JSON Convert `csv` file streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -70,7 +70,7 @@ Examples:
<a id="jc.parsers.csv_s.parse"></a> <a id="jc.parsers.csv_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.date # jc.parsers.date
jc - JSON CLI output utility `date` command output parser jc - JSON Convert `date` command output parser
The `epoch` calculated timestamp field is naive. (i.e. based on the local The `epoch` calculated timestamp field is naive. (i.e. based on the local
time of the system the parser is run on) time of the system the parser is run on)
@ -84,7 +84,7 @@ Examples:
<a id="jc.parsers.date.parse"></a> <a id="jc.parsers.date.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.df # jc.parsers.df
jc - JSON CLI output utility `df` command output parser jc - JSON Convert `df` command output parser
Usage (cli): Usage (cli):
@ -104,7 +104,7 @@ Examples:
<a id="jc.parsers.df.parse"></a> <a id="jc.parsers.df.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.dig # jc.parsers.dig
jc - JSON CLI output utility `dig` command output parser jc - JSON Convert `dig` command output parser
Options supported: Options supported:
- `+noall +answer` options are supported in cases where only the answer - `+noall +answer` options are supported in cases where only the answer
@ -329,7 +329,7 @@ Examples:
<a id="jc.parsers.dig.parse"></a> <a id="jc.parsers.dig.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.dir # jc.parsers.dir
jc - JSON CLI output utility `dir` command output parser jc - JSON Convert `dir` command output parser
Options supported: Options supported:
- `/T timefield` - `/T timefield`
@ -127,7 +127,7 @@ Examples:
<a id="jc.parsers.dir.parse"></a> <a id="jc.parsers.dir.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.dmidecode # jc.parsers.dmidecode
jc - JSON CLI output utility `dmidecode` command output parser jc - JSON Convert `dmidecode` command output parser
Usage (cli): Usage (cli):
@ -132,7 +132,7 @@ Examples:
<a id="jc.parsers.dmidecode.parse"></a> <a id="jc.parsers.dmidecode.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.dpkg\_l # jc.parsers.dpkg\_l
jc - JSON CLI output utility `dpkg -l` command output parser jc - JSON Convert `dpkg -l` command output parser
Set the `COLUMNS` environment variable to a large value to avoid field Set the `COLUMNS` environment variable to a large value to avoid field
truncation. For example: truncation. For example:
@ -138,7 +138,7 @@ Examples:
<a id="jc.parsers.dpkg_l.parse"></a> <a id="jc.parsers.dpkg_l.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.du # jc.parsers.du
jc - JSON CLI output utility `du` command output parser jc - JSON Convert `du` command output parser
Usage (cli): Usage (cli):
@ -94,7 +94,7 @@ Examples:
<a id="jc.parsers.du.parse"></a> <a id="jc.parsers.du.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.env # jc.parsers.env
jc - JSON CLI output utility `env` and `printenv` command output parser jc - JSON Convert `env` and `printenv` command output parser
This parser will output a list of dictionaries each containing `name` and This parser will output a list of dictionaries each containing `name` and
`value` keys. If you would like a simple dictionary output, then use the `value` keys. If you would like a simple dictionary output, then use the
@ -79,7 +79,7 @@ Examples:
<a id="jc.parsers.env.parse"></a> <a id="jc.parsers.env.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.file # jc.parsers.file
jc - JSON CLI output utility `file` command output parser jc - JSON Convert `file` command output parser
Usage (cli): Usage (cli):
@ -69,7 +69,7 @@ Examples:
<a id="jc.parsers.file.parse"></a> <a id="jc.parsers.file.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.finger # jc.parsers.finger
jc - JSON CLI output utility `finger` command output parser jc - JSON Convert `finger` command output parser
Supports `-s` output option. Does not support the `-l` detail option. Supports `-s` output option. Does not support the `-l` detail option.
@ -97,7 +97,7 @@ Examples:
<a id="jc.parsers.finger.parse"></a> <a id="jc.parsers.finger.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.free # jc.parsers.free
jc - JSON CLI output utility `free` command output parser jc - JSON Convert `free` command output parser
Usage (cli): Usage (cli):
@ -79,7 +79,7 @@ Examples:
<a id="jc.parsers.free.parse"></a> <a id="jc.parsers.free.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.fstab # jc.parsers.fstab
jc - JSON CLI output utility `fstab` file parser jc - JSON Convert `fstab` file parser
Usage (cli): Usage (cli):
@ -92,7 +92,7 @@ Examples:
<a id="jc.parsers.fstab.parse"></a> <a id="jc.parsers.fstab.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.group # jc.parsers.group
jc - JSON CLI output utility `/etc/group` file parser jc - JSON Convert `/etc/group` file parser
Usage (cli): Usage (cli):
@ -116,7 +116,7 @@ Examples:
<a id="jc.parsers.group.parse"></a> <a id="jc.parsers.group.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.gshadow # jc.parsers.gshadow
jc - JSON CLI output utility `/etc/gshadow` file parser jc - JSON Convert `/etc/gshadow` file parser
Usage (cli): Usage (cli):
@ -84,7 +84,7 @@ Examples:
<a id="jc.parsers.gshadow.parse"></a> <a id="jc.parsers.gshadow.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.hash # jc.parsers.hash
jc - JSON CLI output utility `hash` command output parser jc - JSON Convert `hash` command output parser
Usage (cli): Usage (cli):
@ -44,7 +44,7 @@ Examples:
<a id="jc.parsers.hash.parse"></a> <a id="jc.parsers.hash.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.hashsum # jc.parsers.hashsum
jc - JSON CLI output utility `hash sum` command output parser jc - JSON Convert `hash sum` command output parser
This parser works with the following hash calculation utilities: This parser works with the following hash calculation utilities:
- `md5` - `md5`
@ -75,7 +75,7 @@ Examples:
<a id="jc.parsers.hashsum.parse"></a> <a id="jc.parsers.hashsum.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.hciconfig # jc.parsers.hciconfig
jc - JSON CLI output utility `hciconfig` command output parser jc - JSON Convert `hciconfig` command output parser
Usage (cli): Usage (cli):
@ -324,7 +324,7 @@ Examples:
<a id="jc.parsers.hciconfig.parse"></a> <a id="jc.parsers.hciconfig.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.history # jc.parsers.history
jc - JSON CLI output utility `history` command output parser jc - JSON Convert `history` command output parser
This parser will output a list of dictionaries each containing `line` and This parser will output a list of dictionaries each containing `line` and
`command` keys. If you would like a simple dictionary output, then use the `command` keys. If you would like a simple dictionary output, then use the
@ -70,7 +70,7 @@ Examples:
<a id="jc.parsers.history.parse"></a> <a id="jc.parsers.history.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.hosts # jc.parsers.hosts
jc - JSON CLI output utility `/etc/hosts` file parser jc - JSON Convert `/etc/hosts` file parser
Usage (cli): Usage (cli):
@ -81,7 +81,7 @@ Examples:
<a id="jc.parsers.hosts.parse"></a> <a id="jc.parsers.hosts.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.id # jc.parsers.id
jc - JSON CLI output utility `id` command output parser jc - JSON Convert `id` command output parser
Usage (cli): Usage (cli):
@ -112,7 +112,7 @@ Examples:
<a id="jc.parsers.id.parse"></a> <a id="jc.parsers.id.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ifconfig # jc.parsers.ifconfig
jc - JSON CLI output utility `ifconfig` command output parser jc - JSON Convert `ifconfig` command output parser
Note: No `ifconfig` options are supported. Note: No `ifconfig` options are supported.
@ -193,7 +193,7 @@ Examples:
<a id="jc.parsers.ifconfig.parse"></a> <a id="jc.parsers.ifconfig.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ini # jc.parsers.ini
jc - JSON CLI output utility `INI` file parser jc - JSON Convert `INI` file parser
Parses standard `INI` files and files containing simple key/value pairs. Parses standard `INI` files and files containing simple key/value pairs.
Delimiter can be `=` or `:`. Missing values are supported. Comment prefix Delimiter can be `=` or `:`. Missing values are supported. Comment prefix
@ -73,7 +73,7 @@ Examples:
<a id="jc.parsers.ini.parse"></a> <a id="jc.parsers.ini.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.iostat # jc.parsers.iostat
jc - JSON CLI output utility `iostat` command output parser jc - JSON Convert `iostat` command output parser
Note: `iostat` version 11 and higher include a JSON output option Note: `iostat` version 11 and higher include a JSON output option
@ -166,7 +166,7 @@ Examples:
<a id="jc.parsers.iostat.parse"></a> <a id="jc.parsers.iostat.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.iostat\_s # jc.parsers.iostat\_s
jc - JSON CLI output utility `iostat` command output streaming parser jc - JSON Convert `iostat` command output streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -107,7 +107,7 @@ Examples:
<a id="jc.parsers.iostat_s.parse"></a> <a id="jc.parsers.iostat_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.iptables # jc.parsers.iptables
jc - JSON CLI output utility `iptables` command output parser jc - JSON Convert `iptables` command output parser
Supports `-vLn` and `--line-numbers` for all tables. Supports `-vLn` and `--line-numbers` for all tables.
@ -170,7 +170,7 @@ Examples:
<a id="jc.parsers.iptables.parse"></a> <a id="jc.parsers.iptables.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.iw\_scan # jc.parsers.iw\_scan
jc - JSON CLI output utility `iw dev <device> scan` command output parser jc - JSON Convert `iw dev <device> scan` command output parser
This parser is considered beta quality. Not all fields are parsed and there This parser is considered beta quality. Not all fields are parsed and there
are not enough samples to test. are not enough samples to test.
@ -128,7 +128,7 @@ Examples:
<a id="jc.parsers.iw_scan.parse"></a> <a id="jc.parsers.iw_scan.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.jar\_manifest # jc.parsers.jar\_manifest
jc - JSON CLI output utility `MANIFEST.MF` file parser jc - JSON Convert `MANIFEST.MF` file parser
Usage (cli): Usage (cli):
@ -84,7 +84,7 @@ Examples:
<a id="jc.parsers.jar_manifest.parse"></a> <a id="jc.parsers.jar_manifest.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.jobs # jc.parsers.jobs
jc - JSON CLI output utility `jobs` command output parser jc - JSON Convert `jobs` command output parser
Also supports the `-l` option. Also supports the `-l` option.
@ -100,7 +100,7 @@ Example:
<a id="jc.parsers.jobs.parse"></a> <a id="jc.parsers.jobs.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.kv # jc.parsers.kv
jc - JSON CLI output utility `Key/Value` file parser jc - JSON Convert `Key/Value` file parser
Supports files containing simple key/value pairs. Delimiter can be `=` or Supports files containing simple key/value pairs. Delimiter can be `=` or
`:`. Missing values are supported. Comment prefix can be `#` or `;`. `:`. Missing values are supported. Comment prefix can be `#` or `;`.
@ -60,7 +60,7 @@ Examples:
<a id="jc.parsers.kv.parse"></a> <a id="jc.parsers.kv.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.last # jc.parsers.last
jc - JSON CLI output utility `last` and `lastb` command output parser jc - JSON Convert `last` and `lastb` command output parser
Supports `-w` and `-F` options. Supports `-w` and `-F` options.
@ -111,7 +111,7 @@ Examples:
<a id="jc.parsers.last.parse"></a> <a id="jc.parsers.last.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ls # jc.parsers.ls
jc - JSON CLI output utility `ls` and `vdir` command output parser jc - JSON Convert `ls` and `vdir` command output parser
Options supported: Options supported:
- `lbaR1` - `lbaR1`
@ -123,7 +123,7 @@ Examples:
<a id="jc.parsers.ls.parse"></a> <a id="jc.parsers.ls.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ls\_s # jc.parsers.ls\_s
jc - JSON CLI output utility `ls` and `vdir` command output streaming jc - JSON Convert `ls` and `vdir` command output streaming
parser parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -84,7 +84,7 @@ Examples:
<a id="jc.parsers.ls_s.parse"></a> <a id="jc.parsers.ls_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.lsblk # jc.parsers.lsblk
jc - JSON CLI output utility `lsblk` command output parser jc - JSON Convert `lsblk` command output parser
Usage (cli): Usage (cli):
@ -281,7 +281,7 @@ Examples:
<a id="jc.parsers.lsblk.parse"></a> <a id="jc.parsers.lsblk.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.lsmod # jc.parsers.lsmod
jc - JSON CLI output utility `lsmod` command output parser jc - JSON Convert `lsmod` command output parser
Usage (cli): Usage (cli):
@ -132,7 +132,7 @@ Examples:
<a id="jc.parsers.lsmod.parse"></a> <a id="jc.parsers.lsmod.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.lsof # jc.parsers.lsof
jc - JSON CLI output utility `lsof` command output parser jc - JSON Convert `lsof` command output parser
Usage (cli): Usage (cli):
@ -126,7 +126,7 @@ Examples:
<a id="jc.parsers.lsof.parse"></a> <a id="jc.parsers.lsof.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.lsusb # jc.parsers.lsusb
jc - JSON CLI output utility `lsusb` command output parser jc - JSON Convert `lsusb` command output parser
Supports the `-v` option or no options. Supports the `-v` option or no options.
@ -268,7 +268,7 @@ Examples:
<a id="jc.parsers.lsusb.parse"></a> <a id="jc.parsers.lsusb.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.mount # jc.parsers.mount
jc - JSON CLI output utility `mount` command output parser jc - JSON Convert `mount` command output parser
Usage (cli): Usage (cli):
@ -82,7 +82,7 @@ Example:
<a id="jc.parsers.mount.parse"></a> <a id="jc.parsers.mount.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.netstat # jc.parsers.netstat
jc - JSON CLI output utility `netstat` command output parser jc - JSON Convert `netstat` command output parser
Caveats: Caveats:
- Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`) - Use of multiple `l` options is not supported on OSX (e.g. `netstat -rlll`)
@ -362,7 +362,7 @@ Examples:
<a id="jc.parsers.netstat.parse"></a> <a id="jc.parsers.netstat.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.nmcli # jc.parsers.nmcli
jc - JSON CLI output utility `nmcli` command output parser jc - JSON Convert `nmcli` command output parser
Supports the following `nmcli` subcommands: Supports the following `nmcli` subcommands:
- `nmcli general` - `nmcli general`
@ -152,7 +152,7 @@ Examples:
<a id="jc.parsers.nmcli.parse"></a> <a id="jc.parsers.nmcli.parse"></a>
### parse #### parse
```python ```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict] def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]

View File

@ -3,7 +3,7 @@
# jc.parsers.ntpq # jc.parsers.ntpq
jc - JSON CLI output utility `ntpq -p` command output parser jc - JSON Convert `ntpq -p` command output parser
Usage (cli): Usage (cli):
@ -213,7 +213,7 @@ Examples:
<a id="jc.parsers.ntpq.parse"></a> <a id="jc.parsers.ntpq.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.passwd # jc.parsers.passwd
jc - JSON CLI output utility `/etc/passwd` file Parser jc - JSON Convert `/etc/passwd` file Parser
Usage (cli): Usage (cli):
@ -101,7 +101,7 @@ Examples:
<a id="jc.parsers.passwd.parse"></a> <a id="jc.parsers.passwd.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ping # jc.parsers.ping
jc - JSON CLI output utility `ping` command output parser jc - JSON Convert `ping` command output parser
Supports `ping` and `ping6` output. Supports `ping` and `ping6` output.
@ -169,7 +169,7 @@ Examples:
<a id="jc.parsers.ping.parse"></a> <a id="jc.parsers.ping.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ping\_s # jc.parsers.ping\_s
jc - JSON CLI output utility `ping` command output streaming parser jc - JSON Convert `ping` command output streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -90,7 +90,7 @@ Examples:
<a id="jc.parsers.ping_s.parse"></a> <a id="jc.parsers.ping_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.pip\_list # jc.parsers.pip\_list
jc - JSON CLI output utility `pip-list` command output parser jc - JSON Convert `pip-list` command output parser
Usage (cli): Usage (cli):
@ -54,7 +54,7 @@ Examples:
<a id="jc.parsers.pip_list.parse"></a> <a id="jc.parsers.pip_list.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.pip\_show # jc.parsers.pip\_show
jc - JSON CLI output utility `pip-show` command output parser jc - JSON Convert `pip-show` command output parser
Usage (cli): Usage (cli):
@ -72,7 +72,7 @@ Examples:
<a id="jc.parsers.pip_show.parse"></a> <a id="jc.parsers.pip_show.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ps # jc.parsers.ps
jc - JSON CLI output utility `ps` command output parser jc - JSON Convert `ps` command output parser
`ps` options supported: `ps` options supported:
- `ef` - `ef`
@ -213,7 +213,7 @@ Examples:
<a id="jc.parsers.ps.parse"></a> <a id="jc.parsers.ps.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.route # jc.parsers.route
jc - JSON CLI output utility `route` command output parser jc - JSON Convert `route` command output parser
Usage (cli): Usage (cli):
@ -115,7 +115,7 @@ Examples:
<a id="jc.parsers.route.parse"></a> <a id="jc.parsers.route.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.rpm\_qi # jc.parsers.rpm\_qi
jc - JSON CLI output utility `rpm -qi` command output parser jc - JSON Convert `rpm -qi` command output parser
Works with `rpm -qi [package]` or `rpm -qia`. Works with `rpm -qi [package]` or `rpm -qia`.
@ -168,7 +168,7 @@ Examples:
<a id="jc.parsers.rpm_qi.parse"></a> <a id="jc.parsers.rpm_qi.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.rsync # jc.parsers.rsync
jc - JSON CLI output utility `rsync` command output parser jc - JSON Convert `rsync` command output parser
Supports the `-i` or `--itemize-changes` options with all levels of Supports the `-i` or `--itemize-changes` options with all levels of
verbosity. This parser will process the STDOUT output or a log file verbosity. This parser will process the STDOUT output or a log file
@ -141,7 +141,7 @@ Examples:
<a id="jc.parsers.rsync.parse"></a> <a id="jc.parsers.rsync.parse"></a>
### parse #### parse
```python ```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict] def parse(data: str, raw: bool = False, quiet: bool = False) -> List[Dict]

View File

@ -3,7 +3,7 @@
# jc.parsers.rsync\_s # jc.parsers.rsync\_s
jc - JSON CLI output utility `rsync` command output streaming parser jc - JSON Convert `rsync` command output streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -95,11 +95,14 @@ Examples:
<a id="jc.parsers.rsync_s.parse"></a> <a id="jc.parsers.rsync_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta
def parse(data: Iterable[str], raw: bool = False, quiet: bool = False, ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple] def parse(data: Iterable[str],
raw: bool = False,
quiet: bool = False,
ignore_exceptions: bool = False) -> Union[Iterable[Dict], tuple]
``` ```
Main text parsing generator function. Returns an iterator object. Main text parsing generator function. Returns an iterator object.

View File

@ -3,7 +3,7 @@
# jc.parsers.sfdisk # jc.parsers.sfdisk
jc - JSON CLI output utility `sfdisk` command output parser jc - JSON Convert `sfdisk` command output parser
Supports the following `sfdisk` options: Supports the following `sfdisk` options:
- `-l` - `-l`
@ -209,7 +209,7 @@ Examples:
<a id="jc.parsers.sfdisk.parse"></a> <a id="jc.parsers.sfdisk.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.shadow # jc.parsers.shadow
jc - JSON CLI output utility `/etc/shadow` file parser jc - JSON Convert `/etc/shadow` file parser
Usage (cli): Usage (cli):
@ -108,7 +108,7 @@ Examples:
<a id="jc.parsers.shadow.parse"></a> <a id="jc.parsers.shadow.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ss # jc.parsers.ss
jc - JSON CLI output utility `ss` command output parser jc - JSON Convert `ss` command output parser
Extended information options like -e and -p are not supported and may cause Extended information options like -e and -p are not supported and may cause
parsing irregularities. parsing irregularities.
@ -287,7 +287,7 @@ Examples:
<a id="jc.parsers.ss.parse"></a> <a id="jc.parsers.ss.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.stat # jc.parsers.stat
jc - JSON CLI output utility `stat` command output parser jc - JSON Convert `stat` command output parser
The `xxx_epoch` calculated timestamp fields are naive. (i.e. based on the The `xxx_epoch` calculated timestamp fields are naive. (i.e. based on the
local time of the system the parser is run on) local time of the system the parser is run on)
@ -177,7 +177,7 @@ Examples:
<a id="jc.parsers.stat.parse"></a> <a id="jc.parsers.stat.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.stat\_s # jc.parsers.stat\_s
jc - JSON CLI output utility `stat` command output streaming parser jc - JSON Convert `stat` command output streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -88,7 +88,7 @@ Examples:
<a id="jc.parsers.stat_s.parse"></a> <a id="jc.parsers.stat_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.sysctl # jc.parsers.sysctl
jc - JSON CLI output utility `sysctl -a` command output parser jc - JSON Convert `sysctl -a` command output parser
Note: Since `sysctl` output is not easily parsable only a very simple Note: Since `sysctl` output is not easily parsable only a very simple
key/value object will be output. An attempt is made to convert obvious key/value object will be output. An attempt is made to convert obvious
@ -64,7 +64,7 @@ Examples:
<a id="jc.parsers.sysctl.parse"></a> <a id="jc.parsers.sysctl.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.systemctl # jc.parsers.systemctl
jc - JSON CLI output utility `systemctl` command output parser jc - JSON Convert `systemctl` command output parser
Usage (cli): Usage (cli):
@ -65,7 +65,7 @@ Examples:
<a id="jc.parsers.systemctl.parse"></a> <a id="jc.parsers.systemctl.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.systemctl\_lj # jc.parsers.systemctl\_lj
jc - JSON CLI output utility `systemctl list-jobs` command output parser jc - JSON Convert `systemctl list-jobs` command output parser
Usage (cli): Usage (cli):
@ -82,7 +82,7 @@ Examples:
<a id="jc.parsers.systemctl_lj.parse"></a> <a id="jc.parsers.systemctl_lj.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.systemctl\_ls # jc.parsers.systemctl\_ls
jc - JSON CLI output utility `systemctl list-sockets` command output jc - JSON Convert `systemctl list-sockets` command output
parser parser
Usage (cli): Usage (cli):
@ -58,7 +58,7 @@ Examples:
<a id="jc.parsers.systemctl_ls.parse"></a> <a id="jc.parsers.systemctl_ls.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.systemctl\_luf # jc.parsers.systemctl\_luf
jc - JSON CLI output utility `systemctl list-unit-files` command output jc - JSON Convert `systemctl list-unit-files` command output
parser parser
Usage (cli): Usage (cli):
@ -54,7 +54,7 @@ Examples:
<a id="jc.parsers.systemctl_luf.parse"></a> <a id="jc.parsers.systemctl_luf.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.systeminfo # jc.parsers.systeminfo
jc - JSON CLI output utility `systeminfo` command output parser jc - JSON Convert `systeminfo` command output parser
Blank or missing elements are set to `null`. Blank or missing elements are set to `null`.
@ -218,7 +218,7 @@ Examples:
<a id="jc.parsers.systeminfo.parse"></a> <a id="jc.parsers.systeminfo.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.time # jc.parsers.time
jc - JSON CLI output utility `/usr/bin/time` command output parser jc - JSON Convert `/usr/bin/time` command output parser
Output from `/usr/bin/time` is sent to `STDERR`, so the `-o` option can be Output from `/usr/bin/time` is sent to `STDERR`, so the `-o` option can be
used to redirect the output to a file that can be read by `jc`. used to redirect the output to a file that can be read by `jc`.
@ -139,7 +139,7 @@ Examples:
<a id="jc.parsers.time.parse"></a> <a id="jc.parsers.time.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.timedatectl # jc.parsers.timedatectl
jc - JSON CLI output utility `timedatectl` command output parser jc - JSON Convert `timedatectl` command output parser
The `epoch_utc` calculated timestamp field is timezone-aware and is only The `epoch_utc` calculated timestamp field is timezone-aware and is only
available if the `universal_time` field is available. available if the `universal_time` field is available.
@ -71,7 +71,7 @@ Examples:
<a id="jc.parsers.timedatectl.parse"></a> <a id="jc.parsers.timedatectl.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.tracepath # jc.parsers.tracepath
jc - JSON CLI output utility `tracepath` command output parser jc - JSON Convert `tracepath` command output parser
Supports `tracepath` and `tracepath6` output. Supports `tracepath` and `tracepath6` output.
@ -138,7 +138,7 @@ Examples:
<a id="jc.parsers.tracepath.parse"></a> <a id="jc.parsers.tracepath.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.traceroute # jc.parsers.traceroute
jc - JSON CLI output utility `traceroute` command output parser jc - JSON Convert `traceroute` command output parser
Supports `traceroute` and `traceroute6` output. Supports `traceroute` and `traceroute6` output.
@ -127,7 +127,7 @@ Examples:
<a id="jc.parsers.traceroute.parse"></a> <a id="jc.parsers.traceroute.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ufw # jc.parsers.ufw
jc - JSON CLI output utility `ufw status` command output parser jc - JSON Convert `ufw status` command output parser
Usage (cli): Usage (cli):
@ -207,7 +207,7 @@ Examples:
<a id="jc.parsers.ufw.parse"></a> <a id="jc.parsers.ufw.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.ufw\_appinfo # jc.parsers.ufw\_appinfo
jc - JSON CLI output utility `ufw app info [application]` command jc - JSON Convert `ufw app info [application]` command
output parser output parser
Supports individual apps via `ufw app info [application]` and all apps list Supports individual apps via `ufw app info [application]` and all apps list
@ -145,7 +145,7 @@ Examples:
<a id="jc.parsers.ufw_appinfo.parse"></a> <a id="jc.parsers.ufw_appinfo.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.uname # jc.parsers.uname
jc - JSON CLI output utility `uname -a` command output parser jc - JSON Convert `uname -a` command output parser
Note: Must use `uname -a` Note: Must use `uname -a`
@ -54,7 +54,7 @@ Example:
<a id="jc.parsers.uname.parse"></a> <a id="jc.parsers.uname.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -8,11 +8,11 @@
# jc.parsers.universal # jc.parsers.universal
jc - JSON CLI output utility universal Parsers jc - JSON Convert universal Parsers
<a id="jc.parsers.universal.simple_table_parse"></a> <a id="jc.parsers.universal.simple_table_parse"></a>
### simple\_table\_parse #### simple\_table\_parse
```python ```python
def simple_table_parse(data: List[str]) -> List[Dict] def simple_table_parse(data: List[str]) -> List[Dict]
@ -37,7 +37,7 @@ Returns:
<a id="jc.parsers.universal.sparse_table_parse"></a> <a id="jc.parsers.universal.sparse_table_parse"></a>
### sparse\_table\_parse #### sparse\_table\_parse
```python ```python
def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict] def sparse_table_parse(data: List[str], delim: str = '\u2063') -> List[Dict]

View File

@ -3,7 +3,7 @@
# jc.parsers.upower # jc.parsers.upower
jc - JSON CLI output utility `upower` command output parser jc - JSON Convert `upower` command output parser
The `updated_epoch` calculated timestamp field is naive. (i.e. based on the The `updated_epoch` calculated timestamp field is naive. (i.e. based on the
local time of the system the parser is run on) local time of the system the parser is run on)
@ -205,7 +205,7 @@ Examples:
<a id="jc.parsers.upower.parse"></a> <a id="jc.parsers.upower.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.uptime # jc.parsers.uptime
jc - JSON CLI output utility `uptime` command output parser jc - JSON Convert `uptime` command output parser
Usage (cli): Usage (cli):
@ -72,7 +72,7 @@ Example:
<a id="jc.parsers.uptime.parse"></a> <a id="jc.parsers.uptime.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.vmstat # jc.parsers.vmstat
jc - JSON CLI output utility `vmstat` command output parser jc - JSON Convert `vmstat` command output parser
Options supported: `-a`, `-w`, `-d`, `-t` Options supported: `-a`, `-w`, `-d`, `-t`
@ -133,7 +133,7 @@ Examples:
<a id="jc.parsers.vmstat.parse"></a> <a id="jc.parsers.vmstat.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.vmstat\_s # jc.parsers.vmstat\_s
jc - JSON CLI output utility `vmstat` command output streaming parser jc - JSON Convert `vmstat` command output streaming parser
> This streaming parser outputs JSON Lines > This streaming parser outputs JSON Lines
@ -107,7 +107,7 @@ Examples:
<a id="jc.parsers.vmstat_s.parse"></a> <a id="jc.parsers.vmstat_s.parse"></a>
### parse #### parse
```python ```python
@add_jc_meta @add_jc_meta

View File

@ -3,7 +3,7 @@
# jc.parsers.w # jc.parsers.w
jc - JSON CLI output utility `w` command output parser jc - JSON Convert `w` command output parser
Usage (cli): Usage (cli):
@ -110,7 +110,7 @@ Examples:
<a id="jc.parsers.w.parse"></a> <a id="jc.parsers.w.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.wc # jc.parsers.wc
jc - JSON CLI output utility `wc` command output parser jc - JSON Convert `wc` command output parser
Usage (cli): Usage (cli):
@ -61,7 +61,7 @@ Examples:
<a id="jc.parsers.wc.parse"></a> <a id="jc.parsers.wc.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.who # jc.parsers.who
jc - JSON CLI output utility `who` command output parser jc - JSON Convert `who` command output parser
Accepts any of the following who options (or no options): `-aTH` Accepts any of the following who options (or no options): `-aTH`
@ -142,7 +142,7 @@ Examples:
<a id="jc.parsers.who.parse"></a> <a id="jc.parsers.who.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.xml # jc.parsers.xml
jc - JSON CLI output utility `XML` file parser jc - JSON Convert `XML` file parser
Usage (cli): Usage (cli):
@ -77,7 +77,7 @@ Examples:
<a id="jc.parsers.xml.parse"></a> <a id="jc.parsers.xml.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.xrandr # jc.parsers.xrandr
jc - JSON CLI output utility `xrandr` command output parser jc - JSON Convert `xrandr` command output parser
Usage (cli): Usage (cli):
@ -144,7 +144,7 @@ Examples:
<a id="jc.parsers.xrandr.parse"></a> <a id="jc.parsers.xrandr.parse"></a>
### parse #### parse
```python ```python
def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict def parse(data: str, raw: bool = False, quiet: bool = False) -> Dict

View File

@ -3,7 +3,7 @@
# jc.parsers.yaml # jc.parsers.yaml
jc - JSON CLI output utility `YAML` file parser jc - JSON Convert `YAML` file parser
Usage (cli): Usage (cli):
@ -91,7 +91,7 @@ Examples:
<a id="jc.parsers.yaml.parse"></a> <a id="jc.parsers.yaml.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -3,7 +3,7 @@
# jc.parsers.zipinfo # jc.parsers.zipinfo
jc - JSON CLI output utility `zipinfo` command output parser jc - JSON Convert `zipinfo` command output parser
Options supported: Options supported:
- none - none
@ -86,7 +86,7 @@ Examples:
<a id="jc.parsers.zipinfo.parse"></a> <a id="jc.parsers.zipinfo.parse"></a>
### parse #### parse
```python ```python
def parse(data, raw=False, quiet=False) def parse(data, raw=False, quiet=False)

View File

@ -2,7 +2,7 @@
# jc # jc
JC - JSON CLI output utility JC - JSON Convert
* kellyjonbrazil@gmail.com * kellyjonbrazil@gmail.com

View File

@ -12,11 +12,11 @@
# jc.streaming # jc.streaming
jc - JSON CLI output utility streaming utils jc - JSON Convert streaming utils
<a id="jc.streaming.streaming_input_type_check"></a> <a id="jc.streaming.streaming_input_type_check"></a>
### streaming\_input\_type\_check #### streaming\_input\_type\_check
```python ```python
def streaming_input_type_check(data: Iterable) -> None def streaming_input_type_check(data: Iterable) -> None
@ -27,7 +27,7 @@ Ensure input data is an iterable, but not a string or bytes. Raises
<a id="jc.streaming.streaming_line_input_type_check"></a> <a id="jc.streaming.streaming_line_input_type_check"></a>
### streaming\_line\_input\_type\_check #### streaming\_line\_input\_type\_check
```python ```python
def streaming_line_input_type_check(line: str) -> None def streaming_line_input_type_check(line: str) -> None
@ -37,7 +37,7 @@ Ensure each line is a string. Raises `TypeError` if not.
<a id="jc.streaming.stream_success"></a> <a id="jc.streaming.stream_success"></a>
### stream\_success #### stream\_success
```python ```python
def stream_success(output_line: Dict, ignore_exceptions: bool) -> Dict def stream_success(output_line: Dict, ignore_exceptions: bool) -> Dict
@ -47,7 +47,7 @@ Add `_jc_meta` object to output line if `ignore_exceptions=True`
<a id="jc.streaming.stream_error"></a> <a id="jc.streaming.stream_error"></a>
### stream\_error #### stream\_error
```python ```python
def stream_error(e: BaseException, line: str) -> Dict def stream_error(e: BaseException, line: str) -> Dict
@ -57,7 +57,7 @@ Return an error `_jc_meta` field.
<a id="jc.streaming.add_jc_meta"></a> <a id="jc.streaming.add_jc_meta"></a>
### add\_jc\_meta #### add\_jc\_meta
```python ```python
def add_jc_meta(func) def add_jc_meta(func)
@ -102,10 +102,11 @@ In all cases above:
<a id="jc.streaming.raise_or_yield"></a> <a id="jc.streaming.raise_or_yield"></a>
### raise\_or\_yield #### raise\_or\_yield
```python ```python
def raise_or_yield(ignore_exceptions: bool, e: BaseException, line: str) -> tuple def raise_or_yield(ignore_exceptions: bool, e: BaseException,
line: str) -> tuple
``` ```
Return the exception object and line string if ignore_exceptions is Return the exception object and line string if ignore_exceptions is

View File

@ -16,11 +16,11 @@
# jc.utils # jc.utils
jc - JSON CLI output utility utils jc - JSON Convert utils
<a id="jc.utils.warning_message"></a> <a id="jc.utils.warning_message"></a>
### warning\_message #### warning\_message
```python ```python
def warning_message(message_lines: List[str]) -> None def warning_message(message_lines: List[str]) -> None
@ -40,7 +40,7 @@ Returns:
<a id="jc.utils.error_message"></a> <a id="jc.utils.error_message"></a>
### error\_message #### error\_message
```python ```python
def error_message(message_lines: List[str]) -> None def error_message(message_lines: List[str]) -> None
@ -60,10 +60,12 @@ Returns:
<a id="jc.utils.compatibility"></a> <a id="jc.utils.compatibility"></a>
### compatibility #### compatibility
```python ```python
def compatibility(mod_name: str, compatible: List, quiet: bool = False) -> None def compatibility(mod_name: str,
compatible: List,
quiet: bool = False) -> None
``` ```
Checks for the parser's compatibility with the running OS Checks for the parser's compatibility with the running OS
@ -85,7 +87,7 @@ Returns:
<a id="jc.utils.has_data"></a> <a id="jc.utils.has_data"></a>
### has\_data #### has\_data
```python ```python
def has_data(data: str) -> bool def has_data(data: str) -> bool
@ -105,7 +107,7 @@ Returns:
<a id="jc.utils.convert_to_int"></a> <a id="jc.utils.convert_to_int"></a>
### convert\_to\_int #### convert\_to\_int
```python ```python
def convert_to_int(value: Union[str, float]) -> Optional[int] def convert_to_int(value: Union[str, float]) -> Optional[int]
@ -124,7 +126,7 @@ Returns:
<a id="jc.utils.convert_to_float"></a> <a id="jc.utils.convert_to_float"></a>
### convert\_to\_float #### convert\_to\_float
```python ```python
def convert_to_float(value: Union[str, int]) -> Optional[float] def convert_to_float(value: Union[str, int]) -> Optional[float]
@ -143,7 +145,7 @@ Returns:
<a id="jc.utils.convert_to_bool"></a> <a id="jc.utils.convert_to_bool"></a>
### convert\_to\_bool #### convert\_to\_bool
```python ```python
def convert_to_bool(value: Union[str, int, float]) -> bool def convert_to_bool(value: Union[str, int, float]) -> bool
@ -163,7 +165,7 @@ Returns:
<a id="jc.utils.input_type_check"></a> <a id="jc.utils.input_type_check"></a>
### input\_type\_check #### input\_type\_check
```python ```python
def input_type_check(data: str) -> None def input_type_check(data: str) -> None
@ -173,7 +175,7 @@ Ensure input data is a string. Raises `TypeError` if not.
<a id="jc.utils.timestamp"></a> <a id="jc.utils.timestamp"></a>
### timestamp Objects ## timestamp Objects
```python ```python
class timestamp() class timestamp()
@ -181,10 +183,11 @@ class timestamp()
<a id="jc.utils.timestamp.__init__"></a> <a id="jc.utils.timestamp.__init__"></a>
### \_\_init\_\_ #### \_\_init\_\_
```python ```python
def __init__(datetime_string: str, format_hint: Union[List, Tuple, None] = None) -> None def __init__(datetime_string: str,
format_hint: Union[List, Tuple, None] = None) -> None
``` ```
Input a datetime text string of several formats and convert to a Input a datetime text string of several formats and convert to a

View File

@ -1,4 +1,4 @@
"""JC - JSON CLI output utility """JC - JSON Convert
* kellyjonbrazil@gmail.com * kellyjonbrazil@gmail.com

View File

@ -1,4 +1,4 @@
"""jc - JSON CLI output utility """jc - JSON Convert
JC cli module JC cli module
""" """
@ -34,7 +34,7 @@ JC_ERROR_EXIT = 100
class info(): class info():
version = __version__ version = __version__
description = 'JSON CLI output utility' description = 'JSON Convert'
author = 'Kelly Brazil' author = 'Kelly Brazil'
author_email = 'kellyjonbrazil@gmail.com' author_email = 'kellyjonbrazil@gmail.com'
website = 'https://github.com/kellyjonbrazil/jc' website = 'https://github.com/kellyjonbrazil/jc'

View File

@ -1,4 +1,4 @@
"""jc - JSON CLI output utility exceptions""" """jc - JSON Convert exceptions"""
class ParseError(Exception): class ParseError(Exception):

View File

@ -1,4 +1,4 @@
"""jc - JSON CLI output utility """jc - JSON Convert
JC lib module JC lib module
""" """

Some files were not shown because too many files have changed in this diff Show More