I am currently using XLSX library to read an Excel sheet as follows.
using DataFrames
using XLSX
df = DataFrame(XLSX.readtable(excel_path, "sheet_name")...)
Now, I would like to read a password-protected Excel file, is there any way to do this? Currently in Python, I use the following solution. Is there any equivalent way in Julia, or is it just not doable at this stage?
import io
import pandas as pd
import msoffcrypto
passwd = 'xyz'
decrypted_workbook = io.BytesIO()
with open(path_to_your_file, 'rb') as file:
office_file = msoffcrypto.OfficeFile(file)
office_file.load_key(password=passwd)
office_file.decrypt(decrypted_workbook)
df = pd.read_excel(decrypted_workbook, sheet_name='abc')
msoffcryptoviaPythonCall.jl, decrypt the file using Python's API, save it a a temporary file and than load the decrypted temporary file withXLXS.jl. Not exactly perfect but this should be quite robust and work well in production.