From 92363be2dd633bdd3c2dd07c72ebd281d2cb4565 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Thu, 23 Sep 2021 08:56:14 -0700 Subject: [PATCH] fix streaming python module example --- README.md | 3 +-- templates/readme_template | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 013ced1d..a6820b4f 100644 --- a/README.md +++ b/README.md @@ -277,12 +277,11 @@ Streaming parsers accept any iterable object and return a generator iterator obj To use the generator object in your code, simply loop through it: ``` -import json import jc.parsers.ls_s result = jc.parsers.ls_s.parse(ls_command_output.splitlines()) for item in result: - item_dict = json.loads(item) + print(item["filename"]) ``` ### Custom Parsers diff --git a/templates/readme_template b/templates/readme_template index 2b59c47f..372c333f 100644 --- a/templates/readme_template +++ b/templates/readme_template @@ -200,12 +200,11 @@ Streaming parsers accept any iterable object and return a generator iterator obj To use the generator object in your code, simply loop through it: ``` -import json import jc.parsers.ls_s result = jc.parsers.ls_s.parse(ls_command_output.splitlines()) for item in result: - item_dict = json.loads(item) + print(item["filename"]) ``` ### Custom Parsers