Spaces:
Sleeping
Sleeping
Changes
Browse files
app.py
CHANGED
@@ -52,6 +52,9 @@ class SkillDetails(BaseModel):
|
|
52 |
class FileResponse(BaseModel):
|
53 |
fileid: int
|
54 |
message: str
|
|
|
|
|
|
|
55 |
|
56 |
|
57 |
|
@@ -69,6 +72,29 @@ def parse_csv(df):
|
|
69 |
parsed = json.loads(res)
|
70 |
return parsed
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
@app.get("/ProfileMatch")
|
73 |
def ProfileMatchResults():
|
74 |
dbQuery = "select * from profilematch"
|
@@ -102,7 +128,7 @@ def create_upload_file(file: bytes = File(...)):
|
|
102 |
lines = content.split('\n')
|
103 |
return {"content": lines}
|
104 |
|
105 |
-
@app.post("/
|
106 |
def upload_PDF(file: UploadFile = File(...)):
|
107 |
text=''
|
108 |
data = json.loads(file.file.read())
|
@@ -113,17 +139,7 @@ def upload_PDF(file: UploadFile = File(...)):
|
|
113 |
|
114 |
return {"message": f"Successfully uploaded {data}"}
|
115 |
|
116 |
-
|
117 |
-
def process_pdf_file(file: bytes = File(...)):
|
118 |
-
# Save file locally for processing
|
119 |
-
text =''
|
120 |
-
reserve_pdf_on_memory = io.BytesIO(file)
|
121 |
-
load_pdf = PyPDF2.PdfReader(reserve_pdf_on_memory)
|
122 |
-
for page in load_pdf.pages:
|
123 |
-
text += page.extract_text()
|
124 |
-
print(text)
|
125 |
-
# Process saved file
|
126 |
-
return {"content": text}
|
127 |
|
128 |
|
129 |
@app.post("/uploadJobDescriptionPDF3/")
|
|
|
52 |
class FileResponse(BaseModel):
|
53 |
fileid: int
|
54 |
message: str
|
55 |
+
class FileUploadDetails(BaseModel):
|
56 |
+
fileData: bytes = File(...)
|
57 |
+
filename: str
|
58 |
|
59 |
|
60 |
|
|
|
72 |
parsed = json.loads(res)
|
73 |
return parsed
|
74 |
|
75 |
+
@app.post("/uploadJobDescriptionPDF/")
|
76 |
+
def process_pdf_file(file: bytes = File(...)):
|
77 |
+
# Save file locally for processing
|
78 |
+
text =''
|
79 |
+
reserve_pdf_on_memory = io.BytesIO(file)
|
80 |
+
load_pdf = PyPDF2.PdfReader(reserve_pdf_on_memory)
|
81 |
+
for page in load_pdf.pages:
|
82 |
+
text += page.extract_text()
|
83 |
+
print(text)
|
84 |
+
# Process saved file
|
85 |
+
return {"content": text}
|
86 |
+
|
87 |
+
@app.post("/uploadJobDescriptionPDF_Fname/")
|
88 |
+
def process_pdf_file1(file: FileUploadDetails):
|
89 |
+
# Save file locally for processing
|
90 |
+
text =''
|
91 |
+
reserve_pdf_on_memory = io.BytesIO(file.fileData)
|
92 |
+
load_pdf = PyPDF2.PdfReader(reserve_pdf_on_memory)
|
93 |
+
for page in load_pdf.pages:
|
94 |
+
text += page.extract_text()
|
95 |
+
print(text)
|
96 |
+
# Process saved file
|
97 |
+
return {"content": text}
|
98 |
@app.get("/ProfileMatch")
|
99 |
def ProfileMatchResults():
|
100 |
dbQuery = "select * from profilematch"
|
|
|
128 |
lines = content.split('\n')
|
129 |
return {"content": lines}
|
130 |
|
131 |
+
@app.post("/uploadJobDescriptionPDF_Test/")
|
132 |
def upload_PDF(file: UploadFile = File(...)):
|
133 |
text=''
|
134 |
data = json.loads(file.file.read())
|
|
|
139 |
|
140 |
return {"message": f"Successfully uploaded {data}"}
|
141 |
|
142 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
143 |
|
144 |
|
145 |
@app.post("/uploadJobDescriptionPDF3/")
|