Skip to content

Commit

Permalink
3.6 support (#1)
Browse files Browse the repository at this point in the history
* Update requirements.txt

* Update python-package.yml

* specified read_excel engine

* Update python-package.yml

* Update spreadsheet_utils.py

* Update spreadsheet_utils.py

* Update spreadsheet_utils.py

* Update spreadsheet_utils.py

* updated supported versions

* Update python-package.yml
  • Loading branch information
PointlessUser committed Aug 23, 2023
1 parent 49788ab commit 49cb6d2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
jobs:
build:

runs-on: ubuntu-latest
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.6","3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
Expand Down
7 changes: 4 additions & 3 deletions mecsimcalc/spreadsheet_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def file_to_dataframe(file: io.BytesIO) -> pd.DataFrame:
df = pd.read_csv(file)
except Exception:
try:
df = pd.read_excel(file)
df = pd.read_excel(file, engine="openpyxl")
except Exception as e:
raise pd.errors.ParserError("File Type Not Supported") from e

Expand Down Expand Up @@ -164,7 +164,7 @@ def print_dataframe(
"odt",
}:
# convert the DataFrame to an excel file
df.to_excel(buf, index=False)
df.to_excel(buf, index=False, engine="openpyxl")
buf.seek(0)

encoded_data = (
Expand All @@ -174,7 +174,8 @@ def print_dataframe(

# if the file type does not match an alias of excel, convert the DataFrame to a csv file
else:
df.to_csv(buf, index=False)
csv_str = df.to_csv(index=False)
buf.write(csv_str.encode())
buf.seek(0)

encoded_data = "data:text/csv;base64," + base64.b64encode(buf.read()).decode()
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pillow ~= 9.0
pandas ~= 1.3
matplotlib ~= 3.5
openpyxl
pillow
pandas >= 1.1.5
matplotlib
openpyxl
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
Expand Down

0 comments on commit 49cb6d2

Please sign in to comment.