Marthee commited on
Commit
9e6686c
·
verified ·
1 Parent(s): 92d9ef6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -9
app.py CHANGED
@@ -37,17 +37,11 @@ def apifunction():
37
  print('here',data)
38
  # Extracting values
39
  if data:
40
- # If `data` contains `allapi` as a string, parse it
41
- if isinstance(data.get("allapi"), str):
42
- import json
43
- allapi = json.loads(data["allapi"])
44
- else:
45
- allapi = data.get("allapi")
46
-
47
- # Pass parsed `allapi` to `apiFiltering`
48
- jsonOutput = pdftotext.apiFiltering(allapi)
49
  return jsonify(jsonOutput)
50
 
 
51
 
52
  except Exception as e:
53
  print(f"Error: {e}")
 
37
  print('here',data)
38
  # Extracting values
39
  if data:
40
+ # Pass the raw JSON data to the filtering function
41
+ jsonOutput = pdftotext.apiFiltering(data)
 
 
 
 
 
 
 
42
  return jsonify(jsonOutput)
43
 
44
+
45
 
46
  except Exception as e:
47
  print(f"Error: {e}")