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

feat(python): Allow loading data from multiple Excel/ODS workbooks and worksheets #20465

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Dec 26, 2024

Extends the recent #20404 update, allowing loading from multiple worksheets while loading from multiple workbooks, following discussion here: #20404 (comment).

(Currently can load one worksheet from multiple workbooks, or multiple worksheets from one workbook - this enables both options at the same time).

Example

pl.read_excel(
    "/path/to/multiple/workbooks/**/data*.xlsx",
    sheet_name=["sheet1","sheet2","sheet3"],
)

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Dec 26, 2024
Copy link

codecov bot commented Dec 26, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.98%. Comparing base (a6fffd4) to head (5575f4b).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
py-polars/polars/io/spreadsheet/functions.py 83.33% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20465      +/-   ##
==========================================
- Coverage   79.00%   78.98%   -0.02%     
==========================================
  Files        1563     1563              
  Lines      220449   220566     +117     
  Branches     2488     2490       +2     
==========================================
+ Hits       174157   174209      +52     
- Misses      45719    45784      +65     
  Partials      573      573              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alexander-beedie alexander-beedie added the A-io-spreadsheet Area: reading/writing Excel/ODS files label Dec 26, 2024
@ritchie46 ritchie46 merged commit 01ac313 into pola-rs:main Dec 27, 2024
20 checks passed
@alexander-beedie alexander-beedie deleted the parse-multiple-workbooks-and-worksheets branch December 27, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io-spreadsheet Area: reading/writing Excel/ODS files enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants