Vaibhav84 commited on
Commit
ca9140a
·
1 Parent(s): 0f5f3bf
Files changed (1) hide show
  1. app.py +10 -35
app.py CHANGED
@@ -97,13 +97,20 @@ def process_pdf_file1(file: bytes = File(...), FileName: str = str):
97
  text += page.extract_text()
98
 
99
  elif FileName.endswith("doc") or FileName.endswith("docx"):
100
- text = docx2txt.process(file.decode("utf-8"))
101
  text = text.read()
102
 
103
  else:
104
  text = file.decode('utf-8')
 
 
 
 
 
 
 
105
  # Process saved file
106
- return {"content": text}
107
  @app.get("/ProfileMatch")
108
  def ProfileMatchResults():
109
  dbQuery = "select * from profilematch"
@@ -129,36 +136,4 @@ def ExtractSkills(skill_data: SkillDetails):
129
  skill_data.requiredSkills = details[0]
130
  skill_data.softSkills = details[1]
131
  skill_data.goodToHaveSkills = details[1]
132
- return skill_data
133
-
134
- @app.post("/uploadJobDescription/")
135
- def create_upload_file(file: bytes = File(...)):
136
- content = file.decode('utf-8')
137
- lines = content.split('\n')
138
- return {"content": lines}
139
-
140
- @app.post("/uploadJobDescriptionPDF_Test/")
141
- def upload_PDF(file: UploadFile = File(...)):
142
- text=''
143
- data = json.loads(file.file.read())
144
-
145
-
146
-
147
-
148
-
149
- return {"message": f"Successfully uploaded {data}"}
150
-
151
-
152
-
153
-
154
- @app.post("/uploadJobDescriptionPDF3/")
155
- def process_pdf_file2(file: Annotated[bytes, File()]):
156
- # Save file locally for processing
157
- text =''
158
- #reserve_pdf_on_memory = io.BytesIO(file)
159
- #load_pdf = PyPDF2.PdfReader(reserve_pdf_on_memory)
160
- #for page in load_pdf.pages:
161
- # text += page.extract_text()
162
- #print(text)
163
- # Process saved file
164
- return {"content": file.content_type }
 
97
  text += page.extract_text()
98
 
99
  elif FileName.endswith("doc") or FileName.endswith("docx"):
100
+ text = docx2txt.process(file)
101
  text = text.read()
102
 
103
  else:
104
  text = file.decode('utf-8')
105
+
106
+ returnID = UploadOpenFile.uploadFile(text,FileName,db_params)
107
+ returnSkills = SkillExtractorDetails.SkillExtract(db_params,skill_extractor,returnID)
108
+ details = returnSkills.split('@')
109
+ #skill_data.requiredSkills = details[0]
110
+ #skill_data.softSkills = details[1]
111
+ #skill_data.goodToHaveSkills = details[1]
112
  # Process saved file
113
+ return {"content": details}
114
  @app.get("/ProfileMatch")
115
  def ProfileMatchResults():
116
  dbQuery = "select * from profilematch"
 
136
  skill_data.requiredSkills = details[0]
137
  skill_data.softSkills = details[1]
138
  skill_data.goodToHaveSkills = details[1]
139
+ return skill_data