Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zaironjacobs committed Jul 8, 2023
2 parents 98675bd + 2ff37f1 commit 9a54caa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/harmony/parsing/wrapper_all_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


def _get_instruments_from_file(file):
if file.file_type == FileType.pdf:
if file.file_type == FileType.pdf or file.file_type == FileType.docx:
instruments_from_this_file = convert_pdf_to_instruments(file)
elif file.file_type == FileType.txt:
instruments_from_this_file = convert_text_to_instruments(file)
Expand Down
3 changes: 2 additions & 1 deletion src/harmony/schemas/enums/file_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
class FileType(str, Enum):
pdf: str = 'pdf'
xlsx: str = 'xlsx'
txt: str = 'txt'
txt: str = 'txt'
docx: str = 'docx'
4 changes: 3 additions & 1 deletion src/harmony/util/file_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ def load_instruments_from_local_file(file_name: str) -> List[Instrument]:
file_type = "pdf"
elif file_name.lower().endswith("xlsx"):
file_type = "xlsx"
elif file_name.lower().endswith("docx"):
file_type = "docx"
else:
file_type = "txt"

if file_type == "pdf" or file_type == "xlsx":
if file_type == "pdf" or file_type == "xlsx" or file_type == "docx":
with open(
file_name,
"rb") as f:
Expand Down

0 comments on commit 9a54caa

Please sign in to comment.