I am trying to upload a csv file to my flask server. What I want to do is to read its content into a dataframe without saving it on the file system. For now I'm using the file.read() method to get the contents of the file, but I'm at loss when it comes to converting these content into a pandas dataframe. Here's the code:
@app.route('/upload', methods=['POST'])
def upload():
file = request.files.get('uploaded_file')
filename = secure_filename(file.filename)
file_content = file.read()
# want to convert these file content into a pandas dataframe
I am able to load it as a dataframe when saving to the disk, but I want to parse the content without saving the uploaded file.