diff --git a/requirements.txt b/requirements.txt index c0bcb62..b15fd62 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file diff --git a/utils/createDf.py b/utils/createDf.py index a753cc4..337c68b 100644 --- a/utils/createDf.py +++ b/utils/createDf.py @@ -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"]: @@ -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):