Skip to content

Commit

Permalink
Issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamgutgutia committed Sep 2, 2024
1 parent 64d9bac commit 94dd494
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
25 changes: 20 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
blinker==1.8.2
click==8.1.7
colorama==0.4.6
defusedxml==0.7.1
et-xmlfile==1.1.0
Flask==3.0.0
pandas==2.0.3
Flask-Cors==4.0.0
gunicorn==21.2.0
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==2.1.5
numpy==2.1.0
odfpy==1.4.1
openpyxl==3.1.2
packaging==24.1
pandas==2.2.2
python-dateutil==2.9.0.post0
python-dotenv==1.0.0
pytz==2024.1
six==1.16.0
tzdata==2024.1
vobject==0.9.6.1
Werkzeug==3.0.4
xlrd==2.0.1
flask-cors==4.0.0
openpyxl==3.1.2
odfpy==1.4.1
gunicorn==21.2.0
6 changes: 4 additions & 2 deletions utils/createDf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pandas import read_csv, read_excel
from pandas import read_csv, read_excel, read_json

def createDf(requestFiles):
if "file" not in requestFiles or not requestFiles["file"]:
Expand All @@ -11,10 +11,12 @@ def createDf(requestFiles):
df = read_excel(file,dtype=str)
elif (file.filename.endswith(".ods")):
df = read_excel(file,engine="odf",dtype=str)
elif (file.filename.endswith(".json")):
df = read_json(file,dtype=str)
else:
return False,"Please upload valid file format"

df = df.applymap(lambda x: x.strip() if isinstance(x,str) else "")
df = df.map(lambda x: x.strip() if isinstance(x,str) else "")
df = df.loc[~(df == "").all(axis=1)]

if not len(df):
Expand Down

0 comments on commit 94dd494

Please sign in to comment.