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
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,10 +35,14 @@ 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
+
-**Automatic header inclusion**: when `cell_range` is specified, frozen rows (headers) are automatically included by default
39
+
- Set `include_frozen_rows=False` to get only the specified range
40
+
- For sheets with `frozen_rows=0`, use `expand_axis_range=True` to include row 1 (for columns) or column A (for rows)
41
+
-**Cell style information** (optional): set `include_cell_styles=True` to get background colors, column widths, and row heights
42
+
- Default is `False` to minimize token usage
43
+
- Useful for identifying highlighted cells, colored headers, or visually emphasized content
44
+
- Response includes cell data in `rows` (value and coordinate) and structural information when available
1. Use `metadata_only=True` to inspect file structure
353
-
2. Identify the required range
354
-
3. Fetch actual data with specific `cell_range`
355
-
356
278
### JSON Output Format
357
279
358
280
#### Read Mode (Default)
@@ -400,7 +322,9 @@ result = sharepoint_excel(
400
322
}
401
323
```
402
324
403
-
#### With Formatting (include_formatting=true)
325
+
#### Merged Cells
326
+
327
+
When merged cells exist, the response includes merged cell information:
404
328
405
329
```json
406
330
{
@@ -414,20 +338,21 @@ result = sharepoint_excel(
414
338
{
415
339
"value": "Department",
416
340
"coordinate": "A1",
417
-
"data_type": "s",
418
-
"fill": {
419
-
"pattern_type": "solid",
420
-
"fg_color": "#CCCCCC",
421
-
"bg_color": null
422
-
},
423
341
"merged": {
424
342
"range": "A1:B1",
425
343
"is_top_left": true
426
-
},
427
-
"width": 15.0,
428
-
"height": 20.0
344
+
}
429
345
}
430
346
]
347
+
],
348
+
"merged_ranges": [
349
+
{
350
+
"range": "A1:B1",
351
+
"anchor": {
352
+
"coordinate": "A1",
353
+
"value": "Department"
354
+
}
355
+
}
431
356
]
432
357
}
433
358
]
@@ -440,12 +365,33 @@ result = sharepoint_excel(
440
365
-**value**: Cell value (string, number, date, formula, etc.)
441
366
-**coordinate**: Cell position (e.g., "A1", "B2")
442
367
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)
368
+
**When merged cells exist:**
446
369
-**merged**: Merged cell information (range, position)
447
-
-**width**: Column width
448
-
-**height**: Row height
370
+
-**merged_ranges**: Merged ranges list per sheet (range + anchor info)
371
+
372
+
### Additional Metadata
373
+
374
+
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`.
375
+
376
+
### Sheet Resolution and Fallbacks
377
+
378
+
-`sheet` is resolved by exact match or a unique `trim + casefold` match.
379
+
- If not resolved, `sheet_resolution` and `available_sheets` are returned with a `warning`.
380
+
- If `cell_range` is provided and `sheet` is not found, the parser falls back to all sheets.
381
+
- If `sheet` is not found and no `cell_range` is provided, `sheets` is empty and `candidates` are returned.
382
+
383
+
### Cell Range Normalization and Expansion
384
+
385
+
`cell_range` is normalized/expanded internally, and the result is returned as `effective_range`.
386
+
387
+
- Column-only ranges (e.g., `J` / `J:J`) expand to `J1:J<max_row>`.
388
+
- Single cell ranges (e.g., `C5`) expand to `C1:C5`.
389
+
- Single-row ranges (e.g., `D5:H5`) expand to `A5:H5`.
390
+
391
+
### Large Range Limits
392
+
393
+
If rows/cols exceed limits, a `ValueError` is raised.
0 commit comments