openpyxl merge requestshttps://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests2024-03-28T11:53:07Zhttps://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/443Preserve extension data in worksheets2024-03-28T11:53:07ZGordon P. HemsleyPreserve extension data in worksheets* Require lxml<5 to avoid BC-breaking issues in 5.0.0.
* Clean up openpyxl.xml.functions to ensure lxml's iterparse is used when available.
* Fix #1745 by maintaining all generic XML elements under extlst.* Require lxml<5 to avoid BC-breaking issues in 5.0.0.
* Clean up openpyxl.xml.functions to ensure lxml's iterparse is used when available.
* Fix #1745 by maintaining all generic XML elements under extlst.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/442Fix up pivot tuples and pCDSDTCEntries.2024-03-27T17:07:41ZsnippetFix up pivot tuples and pCDSDTCEntries.Details in #2161
I would note I don't fully understand why pCDSDTCEntries has a tagname of `pCDSDTCEntries` but seems to come from `<entries>` in the xml, that seems mismatched.
There was also a duplicate definition of `tupleCache` th...Details in #2161
I would note I don't fully understand why pCDSDTCEntries has a tagname of `pCDSDTCEntries` but seems to come from `<entries>` in the xml, that seems mismatched.
There was also a duplicate definition of `tupleCache` that I spotted and removed while I was there.
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/441Add myself to Authors2024-03-16T13:57:22ZPrimož GodecAdd myself to AuthorsSince I was asked in https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/436#note_347052 to add myself in Authors, I am adding myself now.
--HG--
branch : 3.1Since I was asked in https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/436#note_347052 to add myself in Authors, I am adding myself now.
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/440RTD now wants a config file.2024-03-11T11:33:49ZCharlieCRTD now wants a config file.--HG--
branch : 3.1--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/439Add support for metadata.xml2024-03-25T10:47:09ZsnippetAdd support for metadata.xmlThis merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be re...This merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be read in and written) but the additional namespaces and extLst contents are lost which causes file corruption when used with Dynamic Arrays (adding support for these would resolve #1898)
Example: [input.xlsx](/openpyxl/openpyxl/uploads/495b24ebc4a8701423db399555cd70d9/input.xlsx) [test.py](/openpyxl/openpyxl/uploads/12f1dab7e7942041f69c5e8fa170be68/test.py)
If you modify the metadata.xml in the resulting output.xlsx generated from that script to include the full namespaces and extLst, it will load correctly with no corruption.
TODO:
* Add Tests. Some simple tests for metadata types are now running.
* Split `cm`/`vm` out to their own custom cell type (treat it similar to ArrayFormula). I've seen samples of `vm` looking something like
```
<c r="O9" s="3" vm="208">
<f>CUBEVALUE("ThisWorkbookDataModel",$B$5,$C9,O$6,Slicer_Year)</f>
<v>115</v>
</c>
```
and `cm` like
```
<c r="C1" cm="1">
<f t="array" ref="C1:C6">_xlfn.UNIQUE(A1:A50)</f>
<v>27</v>
</c>
```
Note: This is https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/437 rebased to 3.2https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/438Draft: Add support for metadata.xml2024-03-03T22:47:09ZsnippetDraft: Add support for metadata.xmlThis merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be re...This merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be read in and written) but the additional namespaces and extLst contents are lost which causes file corruption when used with Dynamic Arrays (adding support for these would resolve #1898)
Example: [input.xlsx](/openpyxl/openpyxl/uploads/495b24ebc4a8701423db399555cd70d9/input.xlsx) [test.py](/openpyxl/openpyxl/uploads/12f1dab7e7942041f69c5e8fa170be68/test.py)
If you modify the metadata.xml in the resulting output.xlsx generated from that script to include the full namespaces and extLst, it will load correctly with no corruption.
TODO:
* Add Tests. Ideally I'd want to know if this implementation is heading in a good direction before writing them.
* Split up metadata.py into smaller more manageable files. Chucking it all into one giant metadata.py file seems a bit much.
* Remove implementation from cell, create a specialized cell type (MergedCells or ArrayFormulae)
Note: This is https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/437 rebased to 3.2https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/437Draft: Add support for metadata.xml2024-03-05T11:45:19ZsnippetDraft: Add support for metadata.xmlThis merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be re...This merge aims to add support for the metadata.xml. I've implemented the data structures as per https://c-rex.net/samples/ooxml/e1/Part4/OOXML_P4_DOCX_Metadata_topic_ID0EYWT6.html
Currently it has basic round trip support (ie can be read in and written) but the additional namespaces and extLst contents are lost which causes file corruption when used with Dynamic Arrays (adding support for these would resolve #1898)
Example:
[input.xlsx](/uploads/495b24ebc4a8701423db399555cd70d9/input.xlsx)
[test.py](/uploads/12f1dab7e7942041f69c5e8fa170be68/test.py)
If you modify the metadata.xml in the resulting output.xlsx generated from that script to include the full namespaces and extLst, it will load correctly with no corruption.
TODO:
* Add Tests. Ideally I'd want to know if this implementation is heading in a good direction before writing them.
* Split up metadata.py into smaller more manageable files. Chucking it all into one giant metadata.py file seems a bit much.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/436[FIX] Close opened worksheet file that preven't zip closure2024-03-16T12:40:51ZPrimož Godec[FIX] Close opened worksheet file that preven't zip closure### Issue
In newer Python versions >=3.11.8 or >=3.12.2, something seems to change in the garbage collection of the open archive file when the `read_worksheets` function finishes (the worksheet file seems to stay open when the function ...### Issue
In newer Python versions >=3.11.8 or >=3.12.2, something seems to change in the garbage collection of the open archive file when the `read_worksheets` function finishes (the worksheet file seems to stay open when the function finishes - before it was closed by Python). It causes the archive not to close when `self.archive.close()` is called but Python closes it when the script finishes. More here: https://foss.heptapod.net/openpyxl/openpyxl/-/issues/2149#note_345410
### Change
This MR ensures that the worksheet file closes.
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/435remove deprecated use of datetime utcnow2023-12-11T19:38:41ZRafael Santosremove deprecated use of datetime utcnowCloses #2051
--HG--
branch : 3.1Closes #2051
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/434improve custom properties append performance2024-01-21T22:40:13ZRafael Santosimprove custom properties append performanceCloses #2102
--HG--
branch : 3.1Closes #2102
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/433improve custom properties append performance2023-10-22T16:33:32ZRafael Santosimprove custom properties append performancehttps://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/432Read stylesheets with non-contiguous xfId's2023-09-18T23:49:35ZScott BarnesRead stylesheets with non-contiguous xfId'sCurrently Openpyxl cannot properly read stylesheets which contain valid but non-contiguous xfId's in the `<cellStyles>` elements. In the process of renumbering the xfId's, the incoming style information is lost. This MR moves responsibil...Currently Openpyxl cannot properly read stylesheets which contain valid but non-contiguous xfId's in the `<cellStyles>` elements. In the process of renumbering the xfId's, the incoming style information is lost. This MR moves responsibility for renumbering the xfId's from the _NamedStyleCellList.names() method to the Stylesheet._merge_named_styles() method, which allows Stylesheet._expand_named_style() to work as intended.
See also https://foss.heptapod.net/openpyxl/openpyxl/-/issues/1457#note_329545 for an example.
The "pypy3" and "python312" failed CI tests are unrelated to any changes being made here.
Closes #1457.
--HG--
branch : 3.1Scott BarnesScott Barneshttps://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/431Changed the default value for the "allow_blank" parameter to None2024-03-10T15:08:18ZTimoChanged the default value for the "allow_blank" parameter to NoneWhile developing with this helpful library, I noticed that when editing a document with validation that the XML attribute `allow_blank` was dropped from the data validation object. After some debugging, I found out, that the default valu...While developing with this helpful library, I noticed that when editing a document with validation that the XML attribute `allow_blank` was dropped from the data validation object. After some debugging, I found out, that the default value of the `allow_blank` parameter in the constructor of the `DataValidation` class overrode the actual value passed to the `allowBlank` parameter.
Probably further testing would have prevented this bug from being implemented in !419, but for now I have simply corrected the default value for the `allow_blank` parameter to `None`, which should fix the bug and not change the idea behind the default values.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/430Fix for bugs #1842 and #2012: RichText in cells crashes when not using LXML2023-07-04T16:34:17ZChristophe CURISFix for bugs #1842 and #2012: RichText in cells crashes when not using LXMLHello,
I have created a test that shows the problem (it appears only when using ElementTree instead of LXML, that's why it was not seen so far), followed by 2 commits to solve the issue.
Best regards,
Christophe.Hello,
I have created a test that shows the problem (it appears only when using ElementTree instead of LXML, that's why it was not seen so far), followed by 2 commits to solve the issue.
Best regards,
Christophe.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/429Added several tests for the rich_text._opt() method2023-06-30T08:33:07ZUdi FinkelsteinAdded several tests for the rich_text._opt() method--HG--
branch : 3.1
This pull request adds several tests for the _opt method in the CellRichText class.--HG--
branch : 3.1
This pull request adds several tests for the _opt method in the CellRichText class.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/428fix false positive in is_date_format detection.2023-04-19T12:59:04ZLennart Brinkmannfix false positive in is_date_format detection.According to the spec `_` (underline) denotes a skip the width of the next character.
So the underline should be added to the negative lookbehind in the regex.
Resolves #2014.According to the spec `_` (underline) denotes a skip the width of the next character.
So the underline should be added to the negative lookbehind in the regex.
Resolves #2014.https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/427Fix read only worksheets incorrectly handling datetime and timedelta objects ...2023-03-14T14:10:02ZsnippetFix read only worksheets incorrectly handling datetime and timedelta objects when parsingFixes issue #1973 , timedelta cells are correctly identified now. Added tests
--HG--
branch : 3.1Fixes issue #1973 , timedelta cells are correctly identified now. Added tests
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/426Fix formulae that had not been properly split out2023-03-14T10:43:25ZsnippetFix formulae that had not been properly split outFixes the 4 broken formulae listed in #1987. Does this require a test as well? The list could be parsed for if there's a " " in the token and if so, fail. I assume we're never going to get formulae with spaces...
Also I've added myself t...Fixes the 4 broken formulae listed in #1987. Does this require a test as well? The list could be parsed for if there's a " " in the token and if so, fail. I assume we're never going to get formulae with spaces...
Also I've added myself to the authors.
--HG--
branch : 3.1https://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/425Draft: #1967 Update `customFilter` behaviour2024-03-28T19:41:10ZBen CarleyDraft: #1967 Update `customFilter` behaviourThis changes the `customFilter` regex to allow space characters. Excel uses `notEqual val=" "`
to test for non-blank cells.
--HG--
branch : 3.1This changes the `customFilter` regex to allow space characters. Excel uses `notEqual val=" "`
to test for non-blank cells.
--HG--
branch : 3.1Preslav KaranedeffPreslav Karanedeffhttps://foss.heptapod.net/openpyxl/openpyxl/-/merge_requests/424Fix print area being set to a table name2024-03-21T08:32:43ZsnippetFix print area being set to a table nameResolves issue #1942. Parsing documents with print areas set to table names will now issue a warning and just ignore the print area for that sheet.
Openpyxl cannot be reasonably expected to process defined names for print areas if they'...Resolves issue #1942. Parsing documents with print areas set to table names will now issue a warning and just ignore the print area for that sheet.
Openpyxl cannot be reasonably expected to process defined names for print areas if they're set to table names. While this may have been possible if the range was always the entire table, Excel also allows setting it to only a few columns in the table which adds unreasonable complexity.
--HG--
branch : 3.1