Skip to content

xlsx: handle minimal package structure#639

Open
aquasync wants to merge 2 commits intotafia:masterfrom
aquasync:xlsx-minimal-package
Open

xlsx: handle minimal package structure#639
aquasync wants to merge 2 commits intotafia:masterfrom
aquasync:xlsx-minimal-package

Conversation

@aquasync
Copy link
Copy Markdown
Contributor

@aquasync aquasync commented Mar 27, 2026

The code currently assumes the workbook xml (and related files) live in xl/, however this needn't be the case. It further assumes the directory names can be relied upon to infer sheet types.

The first is replaced with reading the document path from _rels/.rels, and the latter from the types in the _rels/workbook.xml.rels.

The code for the rels xml parsing seems a bit clunky; maybe cleaner way to do it with quick_xml, I was just following the approach used elsewhere.

I also considered just ignoring and trying extra known paths (eg "xl/workbook.xml", then "workbook.xml"), however it won't work with something like: arbitrarypath.xlsx.

This is more robust and works with non-standard package layouts.
Not guaranteed to be xl/workbook.xml. Affects paths to many other xml
components as they are relative to the workbook.

Closes tafia#638
@aquasync aquasync force-pushed the xlsx-minimal-package branch from 01fdf1b to ff3413e Compare March 27, 2026 23:14
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

Successfully merging this pull request may close these issues.

1 participant