Remove unused properties in Spreadsheet class

These are no longer used anywhere. Note that pyexcel-xlsx is still
a necessary dependency: it acts as an implicit plugin to pyexcel
that, surprisingly, allows pyexcel to...read excel files [1].

[1]: https://github.com/pyexcel/pyexcel-xlsx#as-a-pyexcel-plugin
This commit is contained in:
Ben Thorner
2021-12-03 13:19:03 +00:00
parent 4a5345f011
commit 3c79675ba2

View File

@@ -1,9 +1,8 @@
import csv
from io import BytesIO, StringIO
from io import StringIO
from os import path
import pyexcel
import pyexcel_xlsx
class Spreadsheet():
@@ -87,19 +86,3 @@ class Spreadsheet():
form.file.data,
filename=form.file.data.filename,
)
@property
def as_rows(self):
if not self._rows:
self._rows = list(csv.reader(
StringIO(self._csv_data),
quoting=csv.QUOTE_MINIMAL,
skipinitialspace=True,
))
return self._rows
@property
def as_excel_file(self):
io = BytesIO()
pyexcel_xlsx.save_data(io, {'Sheet 1': self.as_rows})
return io.getvalue()