Spaces:
Sleeping
Sleeping
Update extract_and_store_supabase.py
Browse files
extract_and_store_supabase.py
CHANGED
@@ -106,14 +106,21 @@ def extract_structure_store_message(user_id: str, message_id: str, attachment_id
|
|
106 |
"normalizedValue": normalized_values
|
107 |
})
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
document_entities['email'] = email
|
118 |
document_entities['message_id'] = message_id
|
119 |
print("Printing parsed json")
|
|
|
106 |
"normalizedValue": normalized_values
|
107 |
})
|
108 |
|
109 |
+
if 'line_item/description' in document_entities:
|
110 |
+
document_entities['line_item_description'] = document_entities['line_item/description']
|
111 |
+
document_entities.pop('line_item/description', None)
|
112 |
+
|
113 |
+
if 'line_item/quantity' in document_entities:
|
114 |
+
document_entities['line_item_quantity'] = document_entities['line_item/quantity']
|
115 |
+
document_entities.pop('line_item/quantity', None)
|
116 |
+
|
117 |
+
if 'line_item/amount' in document_entities:
|
118 |
+
document_entities['line_item_amount'] = document_entities['line_item/amount']
|
119 |
+
document_entities.pop('line_item/amount', None)
|
120 |
+
|
121 |
+
if 'line_item/unit_price' in document_entities:
|
122 |
+
document_entities['line_item_unit_price'] = document_entities['line_item/unit_price']
|
123 |
+
document_entities.pop('line_item/unit_price', None)
|
124 |
document_entities['email'] = email
|
125 |
document_entities['message_id'] = message_id
|
126 |
print("Printing parsed json")
|