OmkarPathak / ResumeParser

A simple resume parser used for extracting information from resumes
MIT License
282 stars 164 forks source link

Upload a file #35

Open mady143 opened 4 years ago

mady143 commented 4 years ago

Hi @OmkarPathak , I am using flask framework i am trying to upload file and extract the info from that file but i am facing an issue related to that i.e, i was only able to upload the files which are present in the same folder i.e, where app.py is located when ever i was trying to upload from different location it was not uploading it was showing an error can you help me to resolve this issue... Thanks and Regards, Manikantha Sekhar..

OmkarPathak commented 4 years ago

I didn't exactly get the issue. Can you please elaborate?

mady143 commented 4 years ago

@OmkarPathak , yeah sure, actually I was uploading the file from the flask frame work this is app.py

app = Flask(__name__)
@app.route('/')
def home():
    return render_template('index.html')

@app.route('/dict_output',methods = ['POST'])
def render():
    if request.method == "POST":
        file = request.form.get('file')
        print("File:",file)
        file_ext = file.split(".")[-1]
        dic = {}
        if file_ext == '.pdf':
            data = ResumeParser(file).get_extracted_data()

        else:
            data = ResumeParser(file).get_extracted_data()
        return data

if __name__ == '__main__':
    app.run()

here while uploading the file from anywhere from my system it's getting an error like no such a file/directory like and while uploading the file from the current folder where app.py and index.html placed its accepting...

Thanks and Regards, Manikantha Sekhar...

OmkarPathak commented 4 years ago

@mady143 can you also please provide your HTML where your form component is used

mady143 commented 4 years ago

@OmkarPathak , bellow you can find app.py and html code screen shots app.py app py screen shot

html.py html screen shot

Thanks and Regards, Manikantha Sekhar...

OmkarPathak commented 4 years ago

@mady143 you can refer this for the same

mady143 commented 4 years ago

Hi @OmkarPathak , I am using ResumeParser library to extract the information from the resume some of the resumes i am getting the total experience and experience and skills ,

now i am getting the exact total experience as bellow

total_exp its is fine enough

and also getting the experience as bellow exp in this experience i want to extract the information clearly with number as a experience not from- present and from-to - from-to like how can i do it

and getting the skills skills how to remove the unnecessary elements in the skills only i want display the particular skills and aspects i want to display

can we do it and it is possible after the extract the information can you explain me how to achieve my result. Thanks and Regards, Manikantha Sekhar..

mady143 commented 4 years ago

Hi @OmkarPathak , my question is i am using flask framework and and working on the same task i.e., resume filtering actually i wrote an API that expalin how the resume and job description dynamically from the front end like

ssss

like the above image i am trying to upload the files and get the outputs now while i was trying to upload the file from the system only where my .py is located from their its self only it was uploading means i am getting an error while uploading from the different location, getting an error like

ddddd

and my code looks like .py and html bellow please open and look once you may understand

1

2

3

5

these are 4 screen shots i have sent all the files expect the output html file

please let me know if your confused and please help me to resolve this issue.

Thanks and Regards, Manikantha Sekhar.

OmkarPathak commented 4 years ago

@mady143 for solving the file path issue, you are only extracting file.filename which gives you ONLY the file name WITHOUT the path.

First, try to open your pdf file directly. So just replace your code:

pdfFileObj = open(filename, 'rb')

with:

pdfFileObj = open(resume_file, 'rb')

If above doesn't work, try this instead. For getting the absolute path, you can use following code before opening the file:

import os
filename = 'abc.pdf'
os.path.abspath(filename)

If you are using Python3 you can better use:

from pathlib import Path
p = Path(filename).resolve()
mady143 commented 4 years ago

Thank you @OmkarPathak for your response let me check and i will let you know if any error

Thanks and Regards, Manikantha Sekhar..

mady143 commented 4 years ago

Hi @OmkarPathak ,

while writing pdfFileObj = open(resume_file, 'rb') this line getting an error

TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileStorage

how to rectify it can you explain

Thanks and Regards, Manikantha Sekhar..

OmkarPathak commented 4 years ago

Hi @OmkarPathak ,

while writing pdfFileObj = open(resume_file, 'rb') this line getting an error

TypeError: stat: path should be string, bytes, os.PathLike or integer, not FileStorage

how to rectify it can you explain

Thanks and Regards, Manikantha Sekhar..

This article might help you: https://viveksb007.github.io/2018/04/uploading-processing-downloading-files-in-flask

mady143 commented 4 years ago

Hi @OmkarPathak , I am using ResumeParser library to extract the information from the resume some of the resumes i am getting the total experience and experience and skills ,

now i am getting the exact total experience as bellow

total_exp its is fine enough

and also getting the experience as bellow exp in this experience i want to extract the information clearly with number as a experience not from- present and from-to - from-to like how can i do it

and getting the skills skills how to remove the unnecessary elements in the skills only i want display the particular skills and aspects i want to display

can we do it and it is possible after the extract the information can you explain me how to achieve my result. Thanks and Regards, Manikantha Sekhar..

can you explain/or any solution for this issue