You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,10 +35,9 @@ Two authentication methods are supported:
35
35
- Read or search Excel files in SharePoint
36
36
- Search mode: find cells containing specific text with `query` parameter
37
37
- Read mode: get data from specific sheets/ranges with `sheet` and `cell_range` parameters
38
-
- Auto-include headers: with `include_header` parameter, automatically includes frozen rows (detected via `freeze_panes`) as headers even when they're outside the specified cell range
39
-
- Metadata-only mode: exclude data rows and retrieve only headers and file structure with `metadata_only` parameter
40
-
- Default: lightweight response with value and coordinate only
41
-
- Optional: include formatting (data_type, fill colors, merged cells, dimensions)
38
+
- Response includes data in `rows` and structure info (`freeze_panes`, `merged_ranges`) when available
39
+
- Default: value + coordinate (structural info such as merged ranges is included when present)
40
+
- Optional: include_formatting currently does not change the output; structural info is still included only when present
42
41
- No Excel Services dependency - uses direct file download + openpyxl parsing
1. Use `metadata_only=True` to inspect file structure
353
-
2. Identify the required range
354
-
3. Fetch actual data with specific `cell_range`
289
+
Note: `include_formatting=true` currently does not return colors/width/height/types.
290
+
Merged cell info (`merged` / `merged_ranges`) is always included when present.
355
291
356
292
### JSON Output Format
357
293
@@ -400,7 +336,10 @@ result = sharepoint_excel(
400
336
}
401
337
```
402
338
403
-
#### With Formatting (include_formatting=true)
339
+
#### Formatting (include_formatting behavior)
340
+
341
+
In the current implementation, `include_formatting=true` does not change the output.
342
+
Merged cell info (`merged` / `merged_ranges`) is included regardless of `include_formatting`.
404
343
405
344
```json
406
345
{
@@ -414,20 +353,21 @@ result = sharepoint_excel(
414
353
{
415
354
"value": "Department",
416
355
"coordinate": "A1",
417
-
"data_type": "s",
418
-
"fill": {
419
-
"pattern_type": "solid",
420
-
"fg_color": "#CCCCCC",
421
-
"bg_color": null
422
-
},
423
356
"merged": {
424
357
"range": "A1:B1",
425
358
"is_top_left": true
426
-
},
427
-
"width": 15.0,
428
-
"height": 20.0
359
+
}
429
360
}
430
361
]
362
+
],
363
+
"merged_ranges": [
364
+
{
365
+
"range": "A1:B1",
366
+
"anchor": {
367
+
"coordinate": "A1",
368
+
"value": "Department"
369
+
}
370
+
}
431
371
]
432
372
}
433
373
]
@@ -440,12 +380,35 @@ result = sharepoint_excel(
440
380
-**value**: Cell value (string, number, date, formula, etc.)
441
381
-**coordinate**: Cell position (e.g., "A1", "B2")
442
382
443
-
**With include_formatting=true:**
444
-
-**data_type**: Data type code (`s`=string, `n`=number, `f`=formula, etc.)
445
-
-**fill**: Fill color information (pattern type, foreground/background colors)
383
+
**When merged cells exist (included regardless of include_formatting):**
446
384
-**merged**: Merged cell information (range, position)
447
-
-**width**: Column width
448
-
-**height**: Row height
385
+
-**merged_ranges**: Merged ranges list per sheet (range + anchor info)
386
+
387
+
Note: `include_formatting` currently does not add formatting fields.
388
+
389
+
### Additional Metadata
390
+
391
+
Depending on the request, the response can include metadata such as `response_kind`, `data_included`, `requested_sheet`, `requested_range`, `freeze_panes`, `frozen_rows`, `frozen_cols`, `effective_range`, `sheet_resolution`, and `available_sheets`.
392
+
393
+
### Sheet Resolution and Fallbacks
394
+
395
+
-`sheet` is resolved by exact match or a unique `trim + casefold` match.
396
+
- If not resolved, `sheet_resolution` and `available_sheets` are returned with a `warning`.
397
+
- If `cell_range` is provided and `sheet` is not found, the parser falls back to all sheets.
398
+
- If `sheet` is not found and no `cell_range` is provided, `sheets` is empty and `candidates` are returned.
399
+
400
+
### Cell Range Normalization and Expansion
401
+
402
+
`cell_range` is normalized/expanded internally, and the result is returned as `effective_range`.
403
+
404
+
- Column-only ranges (e.g., `J` / `J:J`) expand to `J1:J<max_row>`.
405
+
- Single cell ranges (e.g., `C5`) expand to `C1:C5`.
406
+
- Single-row ranges (e.g., `D5:H5`) expand to `A5:H5`.
407
+
408
+
### Large Range Limits
409
+
410
+
If rows/cols exceed limits, a `ValueError` is raised.
0 commit comments