Update app.py
Browse files
app.py
CHANGED
|
@@ -35,6 +35,10 @@ def parse_po_items_with_filters(text):
|
|
| 35 |
"""
|
| 36 |
Parses purchase order items from the extracted text using regex with filters.
|
| 37 |
Ensures items are not merged and handles split descriptions across lines.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
"""
|
| 39 |
lines = text.splitlines()
|
| 40 |
data = []
|
|
@@ -106,7 +110,7 @@ def parse_po_items_with_filters(text):
|
|
| 106 |
# Remove the extracted portion from item 2's description
|
| 107 |
row["Description"] = row["Description"].replace(item_3_description.group(), "").strip()
|
| 108 |
|
| 109 |
-
#
|
| 110 |
for item in data:
|
| 111 |
if item["Item"] == "7":
|
| 112 |
# Remove unwanted text from description
|
|
|
|
| 35 |
"""
|
| 36 |
Parses purchase order items from the extracted text using regex with filters.
|
| 37 |
Ensures items are not merged and handles split descriptions across lines.
|
| 38 |
+
Args:
|
| 39 |
+
text (str): Extracted text from the PDF.
|
| 40 |
+
Returns:
|
| 41 |
+
tuple: A DataFrame with parsed data and a status message.
|
| 42 |
"""
|
| 43 |
lines = text.splitlines()
|
| 44 |
data = []
|
|
|
|
| 110 |
# Remove the extracted portion from item 2's description
|
| 111 |
row["Description"] = row["Description"].replace(item_3_description.group(), "").strip()
|
| 112 |
|
| 113 |
+
# Ensure each description's additional data is handled properly
|
| 114 |
for item in data:
|
| 115 |
if item["Item"] == "7":
|
| 116 |
# Remove unwanted text from description
|