Skip to content

Commit

Permalink
Merge pull request #672 from ostefano/pandas2
Browse files Browse the repository at this point in the history
Update pandas and pandas_ods_reader and patch ods_enrich
  • Loading branch information
adulau authored Jul 19, 2024
2 parents 5b15b4a + a52da45 commit 4711dcb
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 57 deletions.
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ ODTReader = { git = "https://github.com/cartertemm/ODTReader.git/" }
python-pptx = "*"
python-docx = "*"
ezodf = "*"
pandas = "==1.3.5"
pandas_ods_reader = "==0.1.2"
pandas = "*"
pandas_ods_reader = "*"
pdftotext = "*"
lxml = "*"
xlrd = "*"
Expand All @@ -77,7 +77,7 @@ crowdstrike-falconpy = "0.9.0"
censys = "2.0.9"
mwdblib = "3.4.1"
ndjson = "0.3.1"
Jinja2 = "3.1.2"
Jinja2 = ">=3.1.2"
mattermostdriver = "7.3.2"
openpyxl = "*"
slack-sdk = "3.27.1"
Expand Down
119 changes: 66 additions & 53 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion misp_modules/modules/expansion/ods_enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def handler(q=False):
num_sheets = len(doc.sheets)
try:
for i in range(0, num_sheets):
ods = pandas_ods_reader.algo.read_data(pandas_ods_reader.parsers.ods, ods_file, i, headers=False)
rows = pandas_ods_reader.parsers.ods.get_rows(doc, i)
ods = pandas_ods_reader.algo.parse_data(pandas_ods_reader.parsers.ods, rows, headers=False, columns=[], skiprows=0)
ods = pandas_ods_reader.utils.sanitize_df(ods)
ods_content = ods_content + "\n" + ods.to_string(max_rows=None)
return {'results': [{'types': ['freetext'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename},
{'types': ['text'], 'values': ods_content, 'comment': ".ods-to-text from file " + filename}]}
Expand Down

0 comments on commit 4711dcb

Please sign in to comment.