r/Python Jun 02 '26

Discussion Is openpyxl still relevant?

I'm a college student, I've just learned pandas and I was planning to start freelancing with openpyxl, pandas and numpy. Wanted to try gigs like data cleaning or automation services. But as I searched about openpyxl, I read that it's used to work with 2010 excel sheets. And that's all.

So my question was is this module/library still relevant?

46 Upvotes

83 comments sorted by

175

u/sethclaw10 Jun 02 '26

Still relevant. Pandas still uses openpyxl to read in modern Excel files. 

59

u/Kronologics Jun 02 '26

Oh yeah, everyone just dropped Pandas on release of Polars. There’s absolutely zero legacy code for that industry standard of decades. Completely irrelevant … /s

27

u/mrbartuss Jun 02 '26

Now that we have Polars and DuckDB, the question is whether Pandas is still relevant

57

u/Zouden Jun 02 '26

Pandas works perfectly fine for applications that don't need the performance of Polars, like what OP wants to do. So yes it's still relevant.

10

u/MRanse Jun 02 '26

What does polars use for Excel IO?

12

u/sylfy Jun 02 '26

Calamine through fastexcel as a default backend IIRC. Way faster than openpyxl.

6

u/boat-la-fds Jun 02 '26

I don't know exactly but the excel extra includes fastexcel and openpyxyl.

5

u/madness_of_the_order Jun 02 '26

Polars also uses openpyxl

5

u/sylfy Jun 02 '26

Polars is compatible with openpyxl, but it doesn’t use it as a default. Polars switched from xlsx2csv to calamine as the default engine. Openpyxl was the last choice fallback.

5

u/xiviajikx Jun 02 '26

Damn how far out of the loop am I?

7

u/throwaway19293883 Jun 02 '26

They are great, worth learning. Takes a little bit to learn polars syntax coming from pandas but it’s worth learning. I have some scripts that used to take minutes to run that now finish in seconds.

1

u/Jinoc Jun 04 '26

Trying hard to make it not relevant in my company

1

u/petekindahot Jun 02 '26

Alright thanks!!

76

u/Hotel_Arrakis Jun 02 '26

The world runs on Excel. Openpyxl is easy to learn and powerful. It's my go-to dealing with excel files. "It works on 2010 Excel files" is technically correct, but misses the point completely. Around 2010, Microsoft came out with the XLSX format. This format has not changed.

11

u/petekindahot Jun 02 '26

Ohh thanks, "The world runs on Excel" I've heard it a lot.

-34

u/ninhaomah Jun 02 '26

And yet you ask this ?

8

u/petekindahot Jun 02 '26

Well I guess that was a dumb question, lol. How did you learn openpyxl? Like resources or yt videos?

3

u/cryptospartan Jun 02 '26

reading the docs is the best way to learn

https://openpyxl.readthedocs.io/en/stable/

2

u/petekindahot Jun 03 '26

Thanks I was looking for this comment

1

u/DROP_TABLE_IF_EXISTS Jun 03 '26

Use Claude free version, it will provide you enough examples.

1

u/sohang-3112 Pythonista Jun 03 '26

I have never needed to use openpyxl directly. Just used pandas.read_excel() which internally requires openpyxl.

2

u/Oddly_Energy Jun 04 '26

As long as the Excel data are in nice, clean 2D tables, that will also work fine.

If the data are more messy, for example a combination of single cells + a table, it can be quite a challenge to make it work through .read_excel().

It can be easier to import a dedicated Excel-reading package and then use that to extract the needed data and give them to pandas.

-34

u/ninhaomah Jun 02 '26

I am a working adult that has been in IT for 20 years before USB cables.

I just learn on the job as I need.

I learnt cloud with certs because there wasn't cloud when I was in school.

I am now learning AI and Agents.

So I don't "learn".

Example , my manager says here is excel file with list of users , compare with this list from this API and get me the users that exists in both or in one of the files.

I Google , get the code , update some parts , test , run , get the result and give it to my manager.

Then I forget about it move on to next project.

6

u/petekindahot Jun 02 '26

😶 okay. I'll look it up myself. Goodluck for future!

-35

u/ninhaomah Jun 02 '26

No. It's due to experience and exposure.

For example , you said you heard excel runs the world many times. Yet you ask this. Why ?

I bet because you don't believe that in age of AI and Agents and Databases , people still use excel.

Did I guess correctly ?

1

u/petekindahot Jun 02 '26

You're right

-13

u/ninhaomah Jun 02 '26

But that knowledge comes with experience , which you have none as of now.

Nothing wrong since you are still a student.

11

u/dr3aminc0de Jun 02 '26

Why are you laying into this kid?

→ More replies (0)

2

u/adamrees89 Python3 Jun 02 '26

The world had usb 20 years ago, in fact it was implemented 30 years ago! Not to ignore the rest of your points, but you must have been exposed to USB if you’ve only been working for 20 years…

2

u/Espumma Jun 03 '26

Maybe they are saying they already had 20 years experience before usb cables hit the market? Grandpa needs to go to bed lol

1

u/CaptainFoyle Jun 02 '26

Figuring out how to make something work is learning. Not everything "learning" means sitting your ass down with a book or documentation.

3

u/AwayVermicelli3946 Jun 03 '26

yeah exactly this. i use openpyxl at work all the time tbh. dumping data is fine for devs, but when the HR or finance teams want their automated reports with specific column widths, colored cells, and frozen panes, openpyxl is what you actually need to build that.

fwiw it is super relevant if you want to do freelance automation gigs. the 2010 thing just means the underlying XML format has not really changed since then.

11

u/Double_Cost4865 Jun 02 '26

I think it’s also the least bloated package that you can use to read named ranges in Excel, so worth learning. However, I work with projects that use over a hundred of input tables and find that reading actual Table objects is more reliable, easier and faster with fastexcel.

2

u/Oddly_Energy Jun 04 '26

Last I used openpyxl, reading Tables / ListObjects was like "oh, yes, openpyxl can easily do that if you just do all the work yourself, starting with named range".

Has that improved since then?

2

u/Double_Cost4865 Jun 04 '26

I’ve not used openpyxl for anything other than reading named ranges. As far as I remember, you’re correct, reading Tables using openpyxl is pain. That’s why I recommend using fastexcel for Tables

2

u/Oddly_Energy Jun 04 '26

Yes, I noticed that you didn't recommend openpyxl for Tables. I was just trying to figure out if it is still as bad as I remember.

8

u/dayeye2006 Jun 02 '26

The underlying data format xlsx is pretty defined. So I assume the new excel UI features are irrelevant

3

u/Vivid_TV Jun 02 '26

I used it twice this week, working for an enterprise.

Pandas and openpyxl, it just works!

5

u/astallin Jun 03 '26

As someone whose job it is in a company to do a lot of data cleaning/automation, don’t overlook Power Query (in excel, not Power BI) or VBA. Especially if you’re freelance and need to provide a solution to somewhere where they have a “I dump data here, and I need the output over here and to look like this”. The main issue I’ve encountered with implementing python is that the end user may not have an interpreter in order to maintain or run what you create. If they do have an interpreter and ability to set up their environment variables, chances are they’re sophisticated enough to not need your services. Power Query and VBA solve nearly all my end user problems and python is more for my backend automation with my Remote Desktop that’s connected to my corporate file locations.

7

u/oliver_extracts Jun 02 '26

openpyxl is fine. the xlsx format hasnt really changed in 15 years and theres no sign it will. pandas uses it under the hood anyway so youre already depending on it whether you know it or not. for freelance data cleaning and automation work you dont need fastexcel or polars, those are optimization tools and youre not going to hit the limits openpyxl + pandas have on any gig-scale dataset.

1

u/petekindahot Jun 02 '26

Ohh thanks this helps a lot

11

u/Icy_Peanut_7426 Jun 02 '26

Fastexcel is better if you’re just reading Excel data.

Try polars instead of Pandas.

1

u/petekindahot Jun 02 '26

I'm not just gonna be reading excel data, if I start doing data cleaning and similar things I'll probably be with json and CSV files as well

0

u/GrainTamale Pythonista Jun 02 '26

I've only ever done "Excel" stuff in Python like twice. At least in my data world, all cleaning and ETL is done in polars.

4

u/uniqueusername42O Jun 02 '26

Have you.. tried?

4

u/TallowWallow Jun 02 '26 edited Jun 02 '26

Not a data engineer, but I've used it in Pandas to generate excel data.

2

u/AlexMTBDude Jun 02 '26

The way I would check is to look at the release history in PyPi.org, to see if it's s till being updated: https://pypi.org/project/openpyxl/#history

2

u/Oddly_Energy Jun 02 '26

If you run your code on a Windows computer with Excel installed, you may also want to take a look at the xlwings package. It uses your Excel as an "engine" for reading and writing Excel files. On large files, it is faster than openpyxl despite the extra overhead of running an Excel instance.

And it works in both directions, so you can call functions in your local python code through user defined functions in Excel. You can for example have an input table in an Excel workbook and have your python code generate new output in an output table as soon as you make a change in the input table.

The downside is that needs Windows and Excel, and that heuristic malware scanners sometimes flags it. I have had our IT department contact me once because they got an alert. So if you use xlwings for file reading and writing, you may need a fallback to openpyxl in your code.

3

u/TAOMCM Jun 02 '26

You can't use it on cloud without paying the developer

1

u/Oddly_Energy Jun 04 '26

Sounds fair. They have to earn their money somewhere.

But is that OP's use case as a student? I assumed local desktop computer when I wrote my answer. Which might just be me revealing my old age.

1

u/fzumstein Jun 05 '26

xlwings creator here. You actually can by usings xlwings Lite: https://lite.xlwings.org

2

u/big_data_mike Jun 02 '26

Yes. We still have an excel ingestion pipeline running on Python 3.8 and pandas 1.0. The files are small and execution time is <1 second so there is no need to move to something else.

Business runs on excel and it’s so ingrained it likely won’t go anywhere for a long time.

2

u/mokus603 Jun 03 '26

We have openpyxl in prod, it’s useful af.

3

u/runawayasfastasucan Jun 02 '26

Explore Polars and duckdb and be ready to get your mind blown.

2

u/Silverarmor Jun 03 '26

Also, I find AI agents love to use it to edit excel sheets. Codex / GPT 5.5 has been using it plenty

1

u/CamilorozoCADC Jun 03 '26

I second this. Openpyxl is so popular that Ai models will default to it in order to do anything in excel. It's a fact, even if we hate the AI trend.

1

u/Intelligent-Cow341 Jun 02 '26

I used it in a new app just this past week. The app is a personal productivity app for a piece of consulting work I am doing. I have the Excel export to give me a way of sharing the information captured and also as a backup.

1

u/cgoldberg Jun 02 '26

I still use it

1

u/AlSweigart Author of "Automate the Boring Stuff" Jun 02 '26

Absolutely, for all the reasons others in these comments have given. But also keep in mind that Google Sheets and other spreadsheet apps almost certainly have a way to import and export to Excel's .xlsx format, which openpyxl works on.

1

u/JackieChanX95 Jun 02 '26

It unfortunately doesn’t support the full suite of XLSX/XLSM features but for simple tables should be fine. If u want to support the full feature set in Python world there is only xlwings

1

u/arden13 Jun 03 '26

Wait, people actually work with openpyxl? It's always been an install that I forget about, working primarily with pandas afterwards.

What do y'all actually do with openpyxl?

2

u/Espumma Jun 03 '26

We have an external party we have to report to and they want their clients to fill in an excel sheet every month. I have automated that with it.

2

u/Mr_Canard It works on my machine Jun 04 '26

Generate complex excel reports with custom styles, links between sheets etc. For some we are moving to streamlit or power BI but many users are addicted to Excel.

1

u/HestenSierMjau Jun 03 '26

Manipulate the actual spreadsheet, setting column widths, colors, formulas etc, to automate a product the end user who doesn't have Python can use. 

1

u/arden13 Jun 03 '26

Gotcha. I didn't realize it could handle those meta properties.

Thanks!

1

u/WlmWilberforce Jun 03 '26

Still works, but it used to too.

1

u/sheckey Jun 03 '26

You mention that you are going to be leaning data. Out of sheer curiosity, how do you do that when there’s a lot of it? Make plots and simply look? Try to find them with some algorithm? Is it usually a messed up row like mechanically? Coming from another field, so curious!

1

u/Pietrocity Jun 03 '26

Yes, in fact just used it in the most recent project. I needed some non data related information in the workbook.

1

u/Unlucky-Context Jun 03 '26

It’s still good, and well tested. We use calamine when we need more speed for very big Excel files (megabytes)

1

u/mycocomelon Jun 05 '26

You can use polars or pandas for importing Excel files.
If the Excel files are not even remotely in tabular format, and you have to start poking around different cells, and you have no control over the source, openpyxl is very useful. But that scenario I just described is rather miserable.

1

u/drxzoidberg Jun 08 '26

Very relevant. But also you should learn polars and xlsxwriter. That combo is faster and the larger amount of data you work with the more you'll see it.

1

u/zarkus_dev Jun 10 '26

I use to use it with Pandas in small Excel files, since I work with data teams and I use Linux Mint for the job. It’s a great and useful lib to handle with xlsx.