diff --git a/CHANGELOG b/CHANGELOG index 19c37f84..766c9008 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ jc changelog +20210628 v1.15.6 +- Fix issue to only load local plugin parsers that have filenames that end in .py + 20210520 v1.15.5 - Fix issue where help and about information would not display if a 3rd party parser library was missing. (e.g. xmltodict) - Add more error message detail when encountering ParseError and LibraryNotFound exceptions diff --git a/README.md b/README.md index 5c5cc4eb..31bb0c95 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ dig example.com | jc --dig 39049,"data":"93.184.216.34"}],"query_time":49,"server":"2600:1700:bab0:d40::1#53(2600:1700:bab0:d40::1)","when": "Fri Apr 16 16:09:00 PDT 2021","rcvd":56,"when_epoch":1618614540,"when_epoch_utc":null}] ``` -This allows further command-line processing of output with tools like `jq` by piping commands: +This allows further command-line processing of output with tools like `jq` or [`jello`](https://github.com/kellyjonbrazil/jello) by piping commands: ```bash $ dig example.com | jc --dig | jq -r '.[].answer[].data' 93.184.216.34 @@ -60,7 +60,7 @@ The `jc` parsers can also be used as python modules. In this case the output wil '2600:1700:bab0:d40::1#53(2600:1700:bab0:d40::1)', 'when': 'Fri Apr 16 16:13:00 PDT 2021', 'rcvd': 56, 'when_epoch': 1618614780, 'when_epoch_utc': None}] ``` -Two representations of the data are possible. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. +Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. To access the raw, pre-processed JSON, use the `-r` cli option or the `raw=True` function parameter in `parse()`. diff --git a/jc/__init__.py b/jc/__init__.py index 6e6938ff..c1c3d337 100644 --- a/jc/__init__.py +++ b/jc/__init__.py @@ -86,4 +86,4 @@ Module Example: """ name = 'jc' -__version__ = '1.15.5' +__version__ = '1.15.6' diff --git a/jc/cli.py b/jc/cli.py index 14f7b983..e0a3db8c 100644 --- a/jc/cli.py +++ b/jc/cli.py @@ -130,7 +130,7 @@ local_parsers_dir = os.path.join(data_dir, 'jcparsers') if os.path.isdir(local_parsers_dir): sys.path.append(data_dir) for name in os.listdir(local_parsers_dir): - if re.match(r'\w+\.py', name) and os.path.isfile(os.path.join(local_parsers_dir, name)): + if re.match(r'\w+\.py$', name) and os.path.isfile(os.path.join(local_parsers_dir, name)): plugin_name = name[0:-3] local_parsers.append(plugin_name) if plugin_name not in parsers: diff --git a/jc/man/jc.1.gz b/jc/man/jc.1.gz index b7b4c49b..4e75e0f4 100644 Binary files a/jc/man/jc.1.gz and b/jc/man/jc.1.gz differ diff --git a/man/jc.1.gz b/man/jc.1.gz index b7b4c49b..4e75e0f4 100644 Binary files a/man/jc.1.gz and b/man/jc.1.gz differ diff --git a/setup.py b/setup.py index 325f8141..16a536e3 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open('README.md', 'r') as f: setuptools.setup( name='jc', - version='1.15.5', + version='1.15.6', author='Kelly Brazil', author_email='kellyjonbrazil@gmail.com', description='Converts the output of popular command-line tools and file-types to JSON.', diff --git a/templates/readme_template b/templates/readme_template index 4a54f11b..a78568f7 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -19,7 +19,7 @@ dig example.com | jc --dig 39049,"data":"93.184.216.34"}],"query_time":49,"server":"2600:1700:bab0:d40::1#53(2600:1700:bab0:d40::1)","when": "Fri Apr 16 16:09:00 PDT 2021","rcvd":56,"when_epoch":1618614540,"when_epoch_utc":null}] ``` -This allows further command-line processing of output with tools like `jq` by piping commands: +This allows further command-line processing of output with tools like `jq` or [`jello`](https://github.com/kellyjonbrazil/jello) by piping commands: ```bash $ dig example.com | jc --dig | jq -r '.[].answer[].data' 93.184.216.34 @@ -60,7 +60,7 @@ The `jc` parsers can also be used as python modules. In this case the output wil '2600:1700:bab0:d40::1#53(2600:1700:bab0:d40::1)', 'when': 'Fri Apr 16 16:13:00 PDT 2021', 'rcvd': 56, 'when_epoch': 1618614780, 'when_epoch_utc': None}] ``` -Two representations of the data are possible. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. +Two representations of the data are available. The default representation uses a strict schema per parser and converts known numbers to int/float JSON values. Certain known values of `None` are converted to JSON `null`, known boolean values are converted, and, in some cases, additional semantic context fields are added. To access the raw, pre-processed JSON, use the `-r` cli option or the `raw=True` function parameter in `parse()`.