Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XlsxWriter Roadmap #653

Open
jmcnamara opened this issue Aug 31, 2019 · 19 comments
Open

XlsxWriter Roadmap #653

jmcnamara opened this issue Aug 31, 2019 · 19 comments
Assignees

Comments

@jmcnamara
Copy link
Owner

jmcnamara commented Aug 31, 2019

I write and maintain 4 libraries for writing Xlsx files in 4 different programming languages with more or less the same APIs:

See also Note 1.

New features get added to the Perl version first, then the Python version and then the C version. As such a feature request has to be implemented 4 times, with tests and documentation. The Perl and Python versions are almost completely feature compatible. The C version is somewhat behind the others and the Rust version is a work in progress.

This document gives a broad overview of features that are planned to be implemented, in order.

  1. Bugs. These have the highest priority. (Note 2)
  2. Add user defined types to the write() method in XlsxWriter. Feature request: add user defined types to write() #631 Done.
  3. Add hyperlinks to images in Excel::Writer::XLSX Issue 161, fix it in the Python version, and add it to the C version. Done
  4. Learn the phrygian dominant mode in all keys. Close enough.
  5. Fix the issue where duplicate images aren't removed/merged. Feature request: Merge duplicate images #615 In Python, Perl and C versions. Done
  6. Add support for comments to the C version Feature request: worksheet_write_comment() libxlsxwriter#38. Done
  7. Add support for object positioning to the C version. Done
  8. Add support for user defined chart data labels. Feature request: Add Value From Cells for series data_labels source #343 This is the most frequently requested feature across all the libraries. Done
  9. Add header/footer image support to the C version. Done
  10. Learn the altered scale in all keys.
  11. Add conditional formatting to the C library. Done
  12. Add support for new Excel dynamic functions. Done
  13. Add autofilter filter conditions to the C library. Done
  14. Drop Python 2 support. Deprecation notice for Python 2.7 (and 3.5) support. Target July 2021 #720
  15. Add table support to libxlsxwriter. Done
  16. Implement missing features in the C library.
  17. Other frequently requested, and feasible, features, in all 3 versions.

Update for 2023: I will implement a simulated column autofit method in the Python library. The majority of any other effort will go into getting the Rust version of the library to feature compatibility with the Python version.

Notes:

  1. I also wrote a version in Lua, and two other Perl versions (for older Excel file formats) that I no longer actively maintain. I wrote, and open sourced, the first version in January 2000.
  2. Some avoidable bugs have lower priority.
@taozuhong
Copy link

taozuhong commented Mar 28, 2020

I've been watch you and your projects long time, just want to say thank for your great work.

BTW. could you will create library: libxlsx to put xlsx writer and reader toghter in C?

because libxlsx in C could wrapped with python , perl and lua language, that make three projects share a code base, and easy to maintain.

@jmcnamara
Copy link
Owner Author

@taozuhong

could you will create library: libxlsx to put xlsx writer and reader together in C

Unfortunately no. That is too big a task.

@taozuhong
Copy link

Yeah, it's a big task, but you are the right person to create the project and make a road-map, maybe I or others could give it a hand to make it done.

Just try it, put others to time.

@jmcnamara
Copy link
Owner Author

jmcnamara commented Apr 1, 2020

but you are the right person to create the project and make a road-map, maybe I or others could give it a hand to make it done.

Thank you for the vote of confidence. I actually started creating an Xlsx reader in Perl a few years ago (Excel::Reader::XLSX). However, although it worked for its use case (of reading data from an Xlsx file) it became clear that even for that subset it was a very big task. Some of the issues were:

  • The Xlsx XML spec is quite permissive. This is good but allows a wide range of "valid" xlsx formats produced by different (non-Excel) tools that are hard to parse.
  • People rarely want to read just data. They want to know obscure things like which fonts were used in a rich string.
  • Also, I have a somewhat completist approach to software so this wouldn't be a task that I think I could finish to the standard that I would like.

So, overall this isn't something that I want to attempt, even from a co-ordination point of view. However, there are other Open Source libraries in a variety of languages that support reading and rewriting Excel Xlsx files.

@arildb
Copy link

arildb commented Mar 3, 2021

Excel has support for comments and notes in a cell.
The current API only supports comments, it seems.

Will note support be added, or is there a way to create cell notes currently?

@jmcnamara
Copy link
Owner Author

Will note support be added

It is unlikely. There are several additional subfiles within the file format that are required to support this. Also, since this feature was only added in recent versions of Excel it makes writing tests a little tricky.

@frndfrts
Copy link

frndfrts commented Dec 2, 2021

Any plans on supporting the definition and application of Excel Styles to cells? Thanks.

@jmcnamara
Copy link
Owner Author

Any plans on supporting the definition and application of Excel Styles to cells?

Do you mean "Cell Styles" like like on the "Home" tab of the Excel ribbon bar? If so there aren't any plans to support those. The internal handling of styles is tricky and has to be managed carefully in relation to normal cell formats. Also, it isn't a frequently requested feature so overall it is unlikely to be supported.

@wilcoxon
Copy link

wilcoxon commented Mar 8, 2022

I know it is not possible to do AutoFit for columns. Is it possible to implement autosize for comments (eg set comment_object.Shape.TextFrame.AutoSize = True)? Unlike column AutoFit, this appears to persist across edits to the comments which makes me think it is a "real" setting (and not just runtime calculations within Excel).

@jmcnamara
Copy link
Owner Author

@wilcoxon I think that should be possible. Can you open a new feature request for it.

@dimiboi
Copy link

dimiboi commented Dec 27, 2022

@jmcnamara, any plans to implement data table support?

@jmcnamara
Copy link
Owner Author

any plans to implement data table support?

They may work already as a normal formula. There is some additional attributes require but Excel may just calculate it anyway. Otherwise it isn't requested enough (this is the first time) to add to the roadmap.

@dimiboi
Copy link

dimiboi commented Dec 29, 2022

Unfortunately, it doesn't seem to work as a normal formula unless there is a workaround that I am not aware of.

@jmcnamara
Copy link
Owner Author

jmcnamara commented Nov 3, 2023

Roadmap V2

XlsxWriter is almost 10 years old. The first version was released was in February 17 2013. According to pypinfo it has around 12 million monthly downloads so it is probably fair to say that it has been useful.

Recently I have been porting/rewriting XlsxWriter in Rust and it has been an interesting experience. When I'm finished with the Rust port, sometime next year, I'd like to revisit XlsxWriter and bring it up to date with modern Python and practice. Some ideas:

  • Type annotation with documentation on all (200) public APIs.
  • Better error handling and reporting. Also better API argument testing with the help of the type annotations.
  • More exceptions.
  • A Image type like in the Rust version. This would make improvements like a worksheet.insert_image_fit_to_cell() method easier to implement.
  • A Color type like in the Rust version which will allow a uniform implementation of theme colors (often requested).
  • Maybe a Formula type like in the Rust version.
  • Better autofit().
  • More modular structuring of the Chart internals to allow more formatting.
  • Other cleanups and refactoring.

Update: I've moved this to its own issue for comments and suggestions.

Repository owner deleted a comment from GavinMGlynn Feb 18, 2024
@jmcnamara
Copy link
Owner Author

XlsxWriter v3.2.0 has been released with support for embedded images in cells. This is equivalent to Excel's menu item to insert an image using the option to "Place in Cell". It scales images automatically to the dimensions of the cell.

This has been a frequently requested feature for people creating spreadsheets with images for product items.

Example:

import xlsxwriter


# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook("embedded_images.xlsx")
worksheet = workbook.add_worksheet()

# Widen the first column to make the caption clearer.
worksheet.set_column(0, 0, 30)
worksheet.write(0, 0, "Embed images that scale to cell size")

# Embed an images in cells of different widths/heights.
worksheet.set_column(1, 1, 14)

worksheet.set_row(1, 60)
worksheet.embed_image(1, 1, "python.png")

worksheet.set_row(3, 120)
worksheet.embed_image(3, 1, "python.png")

workbook.close()

Output:
screenshot 2

@jmcnamara
Copy link
Owner Author

jmcnamara commented Feb 18, 2024

Also, just to note that v3.2.0 is the 10th anniversary release of XlsxWriter.

Version 0.0.1 was released on February 17 2013. Since then there have been 167 releases, 25,000 lines of code, 1600 test cases, 700 pages of documentation, 71,000 users on GitHub, 50 contributors, 1000 closed issues and 150 million yearly downloads.

Thanks to everyone who has contributed code, given feedback or just used the library.

@tritueviet
Copy link

Can you next for support open exist excel as template?

@jmcnamara
Copy link
Owner Author

Can you next for support open exist excel as template?

An Excel file can't (except for very simple cases) be templated like a text file or a html file since it is actually a collection of files and they have inter-referential linkages. So in general you need to parse the file into a collection of data structures and then write it out again. I gave an explanation a bit further up this thread about why I don't plan to tackle file reading: #653 (comment)

So, unfortunately, this is something that I won't be tackling. OpenPyXL does a good job of supporting file reading/templating if you care to look at that.

@tritueviet
Copy link

Can you next for support open exist excel as template?

An Excel file can't (except for very simple cases) be templated like a text file or a html file since it is actually a collection of files and they have inter-referential linkages. So in general you need to parse the file into a collection of data structures and then write it out again. I gave an explanation a bit further up this thread about why I don't plan to tackle file reading: #653 (comment)

So, unfortunately, this is something that I won't be tackling. OpenPyXL does a good job of supporting file reading/templating if you care to look at that.

Thanks very much. i think i need using other open source to rewrite the data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants