Vaibhav84 commited on
Commit
4006ccd
·
1 Parent(s): d474c84
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -3,6 +3,8 @@ from fastapi import FastAPI,File, UploadFile
3
  from pydantic import BaseModel
4
  import json
5
  from typing_extensions import Annotated
 
 
6
 
7
  #SkillExtraction Packages
8
  import PyPDF2
@@ -97,7 +99,7 @@ def uploadJobDescription(file: bytes = File(...), FileName: str = "sample.pdf")
97
  responseData = responseData + 'Soft Skills : ' + details[1] +'<br><br>'
98
  responseData = responseData + 'Good to have Skills : ' + details[2]
99
  return {"SkillDetails": responseData}
100
- @app.get("/ProfileMatch")
101
  def ProfileMatchResults():
102
  dbQuery = "select * from profilematch"
103
  conn = psycopg2.connect(**db_params)
@@ -122,4 +124,16 @@ def ExtractSkills(skill_data: SkillDetails):
122
  skill_data.requiredSkills = details[0]
123
  skill_data.softSkills = details[1]
124
  skill_data.goodToHaveSkills = details[1]
125
- return skill_data
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  from pydantic import BaseModel
4
  import json
5
  from typing_extensions import Annotated
6
+ from fastapi.encoders import jsonable_encoder
7
+ from fastapi.responses import JSONResponse
8
 
9
  #SkillExtraction Packages
10
  import PyPDF2
 
99
  responseData = responseData + 'Soft Skills : ' + details[1] +'<br><br>'
100
  responseData = responseData + 'Good to have Skills : ' + details[2]
101
  return {"SkillDetails": responseData}
102
+ @app.get("/AllProfileMatchResults")
103
  def ProfileMatchResults():
104
  dbQuery = "select * from profilematch"
105
  conn = psycopg2.connect(**db_params)
 
124
  skill_data.requiredSkills = details[0]
125
  skill_data.softSkills = details[1]
126
  skill_data.goodToHaveSkills = details[1]
127
+ return skill_data
128
+
129
+ from datetime import datetime
130
+ from typing import Union
131
+ class Item(BaseModel):
132
+ title: str
133
+ timestamp: datetime
134
+ description: Union[str, None] = None
135
+
136
+ @app.post("/getProfileMatchResultsByName/{id}")
137
+ def ExtractSkills(id: str, item: Item):
138
+ json_compatible_item_data = jsonable_encoder(item)
139
+ return JSONResponse(content=json_compatible_item_data)