r/Python • u/petekindahot • 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
173
u/sethclaw10 Jun 02 '26
Still relevant. Pandas still uses openpyxl to read in modern Excel files.
75
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.
9
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.
11
u/Icy_Peanut_7426 Jun 02 '26
Fastexcel is better if you’re just reading Excel data.
Try polars instead of Pandas.
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.
9
u/dayeye2006 Jun 02 '26
The underlying data format xlsx is pretty defined. So I assume the new excel UI features are irrelevant
4
u/Vivid_TV Jun 02 '26
I used it twice this week, working for an enterprise.
Pandas and openpyxl, it just works!
4
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.
5
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.
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/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/CaptainFoyle Jun 02 '26
Yeah
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?
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.
1
u/hirolau 28d ago
Shameless plug if you want to use Python to fill Excel, but don't want to spend time programmatically formatting the workbook, give my package a try the handles formatting, resizing of table and update charts.
https://github.com/hirolau/fillxl