Marthee commited on
Commit
0de9f49
·
verified ·
1 Parent(s): e66ae0b

Update pdftotext.py

Browse files
Files changed (1) hide show
  1. pdftotext.py +9 -8
pdftotext.py CHANGED
@@ -127,17 +127,18 @@ def texts_from_pdf(pdfshareablelinks, heading_to_search):
127
 
128
 
129
  def apiFiltering(apitext):
 
 
 
130
  for item in apitext:
131
  project_template_details = item.get('projecttemplatedetails', [])
132
  for detail in project_template_details:
133
- detail_id = detail.get('id') # Get the `id` field from the detail
134
- projecttemplateid = detail.get('projecttemplateid') # Get the `projecttemplateid` field
135
- bqcode = detail.get('bqcodelibrary', {}).get('bqcode') # Get the `bqcode` field from the third {}
136
-
137
- # Print or store the values as needed
138
- print(f"ID: {detail_id}, Project Template ID: {projecttemplateid}, BQCode: {bqcode}")
139
-
140
-
141
  # import fitz
142
 
143
  # import tsadropboxretrieval
 
127
 
128
 
129
  def apiFiltering(apitext):
130
+
131
+ filtered_items = []
132
+
133
  for item in apitext:
134
  project_template_details = item.get('projecttemplatedetails', [])
135
  for detail in project_template_details:
136
+ filtered_items.append({
137
+ "id": detail.get('id'),
138
+ "projecttemplateid": detail.get('projecttemplateid'),
139
+ "bqcode": detail.get('bqcodelibrary', {}).get('bqcode')
140
+ })
141
+ return filtered_items
 
 
142
  # import fitz
143
 
144
  # import tsadropboxretrieval