From 7ee30070703191055db86188afee6de19ebadabb Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sun, 29 Aug 2021 04:33:24 -0700 Subject: [PATCH] Get ID, QUERY, TYPE, CATEGORY properties from org property drawer when present --- src/processor/org_mode/org_to_jsonl.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/processor/org_mode/org_to_jsonl.py b/src/processor/org_mode/org_to_jsonl.py index 7db21178..0cb587a3 100644 --- a/src/processor/org_mode/org_to_jsonl.py +++ b/src/processor/org_mode/org_to_jsonl.py @@ -120,6 +120,14 @@ def convert_org_entries_to_jsonl(entries, verbose=0): if verbose > 2: print(f"Body: {entry.Body()}") + for property_key in ('ID', 'QUERY', 'TYPE', 'CATEGORY'): + if entry.Property(property_key): + if 'Property' not in entry_dict: + entry_dict['Property'] = dict() + entry_dict['Property'][property_key] = entry.Property(property_key) + if verbose > 2: + print(f'Property: {entry_dict["PROPERTY"][property_key]}') + if entry_dict: # Convert Dictionary to JSON and Append to JSONL string jsonl += f'{json.dumps(entry_dict, ensure_ascii=False)}\n'