diff --git a/.gitignore b/.gitignore index 1ae9b0e0..3732a1e5 100755 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ dist/ build/ *.egg-info/ .github/ +.vscode/ +_config.yml diff --git a/CHANGELOG b/CHANGELOG index 384693cf..5c1e86b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -43,7 +43,7 @@ jc changelog 20210720 v1.16.0 - Note to Package Maintainers: TL;DR: `/man/jc.1.gz` and `/jc/man/jc.1.gz` are deprecated and only `/man/jc.1` should be used. - + The Man page in the PyPi source packages will be moving from `/jc/man/jc.1.gz` to `/man/jc.1` in version 1.17.0. For now the Man pages will be available in both locations, but be aware that the Man page at `/jc/man/jc.1.gz` is now considered deprecated. @@ -58,7 +58,7 @@ jc changelog - Binaries and DEB/RPM/MSI packages now include Python 3.9.5 interpreter 20210628 v1.15.6 -- Fix issue to only load local plugin parsers that have filenames that end in .py +- 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) diff --git a/README.md b/README.md index 3dc2b22f..e11519a5 100644 --- a/README.md +++ b/README.md @@ -294,7 +294,7 @@ Custom local parser plugins may be placed in a `jc/jcparsers` folder in your loc - macOS: `$HOME/Library/Application Support/jc/jcparsers` - Windows: `$LOCALAPPDATA\jc\jc\jcparsers` -Local parser plugins are standard python module files. Use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) parser as a template and simply place a `.py` file in the `jcparsers` subfolder. +Local parser plugins are standard python module files. Use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) or [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py) parser as a template and simply place a `.py` file in the `jcparsers` subfolder. Local plugin filenames must be valid python module names, therefore must consist entirely of alphanumerics and start with a letter. Local plugins may override default parsers. diff --git a/docs/parsers/csv_s.md b/docs/parsers/csv_s.md index 8967538a..4ff04d50 100644 --- a/docs/parsers/csv_s.md +++ b/docs/parsers/csv_s.md @@ -16,7 +16,9 @@ Usage (cli): Usage (module): import jc.parsers.csv_s - result = jc.parsers.csv_s.parse(csv_output) + result = jc.parsers.csv_s.parse(csv_output.splitlines()) # result is an iterable object + for item in result: + # do something Schema: @@ -24,7 +26,13 @@ Schema: { "column_name1": string, - "column_name2": string + "column_name2": string, + "_jc_meta": # This object only exists if using -qq or ignore_exceptions=True + { + "success": booean, # true if successfully parsed, false if error + "error": string, # exists if "success" is false + "line": string # exists if "success" is false + } } Examples: diff --git a/jc/parsers/csv_s.py b/jc/parsers/csv_s.py index b357227c..c918d00d 100644 --- a/jc/parsers/csv_s.py +++ b/jc/parsers/csv_s.py @@ -13,7 +13,9 @@ Usage (cli): Usage (module): import jc.parsers.csv_s - result = jc.parsers.csv_s.parse(csv_output) + result = jc.parsers.csv_s.parse(csv_output.splitlines()) # result is an iterable object + for item in result: + # do something Schema: @@ -21,7 +23,13 @@ Schema: { "column_name1": string, - "column_name2": string + "column_name2": string, + "_jc_meta": # This object only exists if using -qq or ignore_exceptions=True + { + "success": booean, # true if successfully parsed, false if error + "error": string, # exists if "success" is false + "line": string # exists if "success" is false + } } Examples: diff --git a/templates/readme_template b/templates/readme_template index 608b83b0..ea81e823 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -213,7 +213,7 @@ Custom local parser plugins may be placed in a `jc/jcparsers` folder in your loc - macOS: `$HOME/Library/Application Support/jc/jcparsers` - Windows: `$LOCALAPPDATA\jc\jc\jcparsers` -Local parser plugins are standard python module files. Use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) parser as a template and simply place a `.py` file in the `jcparsers` subfolder. +Local parser plugins are standard python module files. Use the [`jc/parsers/foo.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo.py) or [`jc/parsers/foo_s.py (streaming)`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/foo_s.py) parser as a template and simply place a `.py` file in the `jcparsers` subfolder. Local plugin filenames must be valid python module names, therefore must consist entirely of alphanumerics and start with a letter. Local plugins may override default parsers.