Bottom Page

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Python read Password protected excel and convert to Pandas DataFrame
#1
Hi All,

I am new to Python and now actively learning pandas.

I am trying to read a password protected excel file (prompt for password upon open). Surfing on the net and got below solution using win32com object.

xlApp = win32com.client.Dispatch("Excel.Application")
xlwb = xlApp.Workbooks.Open("c:\\temp\\SomeFile.xlsx", False, True, None, password)

However, I want to convert workbook xlwb into a pandas dataframe for some advance processing. I am struggle to find any efficient ways, except flush it to csv and read it again using pandas read_csv function.

Do you have any good suggestion to this?

Also the win32com solution won't be working in Linux server. Is there any generic/native solution so that Python program can read through a password protected excel in any operating systems?

Thank you very much.

Allen
Quote
#2
https://davidhamann.de/2018/02/21/read-p...dataframe/

but still no linux
Quote
#3
Thank you Buran. Your link is good by promoting user to enter password on the fly when program opens the excel file.

However, my wish is to run everything in the background without manual intervention.

My colleague said Java can do this seamlessly so I think Python could do the same.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  manipulating a dataframe - pandas nsx200 2 98 Nov-14-2019, 10:38 AM
Last Post: nsx200
  Pandas dataframe columns collapsed in Spyder when printing UniKlixX 2 112 Nov-04-2019, 07:00 AM
Last Post: UniKlixX
  pandas dataframe iloc mystery edvvardbrian 2 175 Oct-29-2019, 02:55 PM
Last Post: jefsummers
  How to add a few empty rows into a pandas dataframe python_newbie09 2 528 Sep-20-2019, 08:52 AM
Last Post: python_newbie09
  Dropping a column from pandas dataframe marco_ita 6 733 Sep-07-2019, 08:36 AM
Last Post: marco_ita
  created a pandas series instead of pandas DataFrame ibaad1406 6 598 Sep-06-2019, 06:23 AM
Last Post: ibaad1406
  Applying operation to a pandas multi index dataframe subgroup Nuovoq 1 352 Sep-04-2019, 10:04 PM
Last Post: Nuovoq
  Substr on Pandas Dataframe Scott 1 396 Sep-02-2019, 02:49 AM
Last Post: scidam
  Pandas Dataframe to Google Big Query Ecniv 1 470 Aug-21-2019, 04:56 PM
Last Post: ThomasL
  how to apply user defined function to Pandas DataFrame evelynow 3 674 Aug-20-2019, 11:35 PM
Last Post: scidam

Forum Jump:


Users browsing this thread: 1 Guest(s)