sheetmap
Draw labelled cell ranges over Excel worksheets. Each mapped sheet becomes a PNG showing its
contents, fills, borders and merged cells, with every region outlined and tagged with its label.
The PNGs are gathered into one standalone HTML page, side by side where they fit. With --review,
readers can also click a label to ask for a range to be removed or changed, then copy a summary of
their requests.
Use it to check that a parser, schema or extraction reads the cells you think it does, and to let someone who knows the workbook review those choices without reading code.
Run the example
From this folder:
uv run sheetmap examples/lab/map.yaml
Open examples/lab/map.html. The example workbook holds invented data.
To check a map against its workbook without writing anything, for example in CI:
uv run sheetmap check examples/lab/map.yaml
Write a map
A map file names a workbook and the regions to label. Paths resolve relative to the map file.
title: Lab report
workbook: january.xlsx
subtitle: January example
preview:
Raw_Data: {rows: 12, columns: 6}
regions:
- {label: patient, ref: "Report!B3"}
- label: results
ref: "Report!A7:D"
columns: {A: sample_id, C: analyte, D: value}
- {label: flags, ref: "Report!F8:F", kind: list}
- {label: signals, ref: "Raw_Data!A1:D", kind: table}
Each region needs a label, unique within its map, and a ref:
ref |
Meaning |
|---|---|
B3 |
One cell on the first worksheet |
Report!B3 |
One cell on the Report sheet; quote names with spaces: 'Raw data'!B3 |
Report!A7:D20 |
A rectangle |
Report!A7:D |
Open-ended: runs to the last row with a value in columns A to D |
A region can also take:
kind:cell,range,listortable, which sets its colour. It defaults totablewhencolumnsorrowsare given,cellfor one cell andrangeotherwise.columns: labels for table columns, keyed by letter. A column without a label continues the label on its left when its cells are empty, so merged headers share one label. A column that has values but no label is an error, because it usually means the mapping has missed something.rows: labels for a table that reads across, keyed by row number. Givecolumnsorrows, not both.colour: a hex colour such as#be123c, overriding the colour for its kind.
A label for one cell of a merged block highlights the whole block.
A map file can set layout and review for the page, as described below. A map can also take:
titleandsubtitle, shown above each image. The title defaults to the workbook's name.key, which tells apart two maps with the same title. It defaults to the title and workbook name.preview, which limits named sheets to a number ofrowsandcolumns. The preview always includes the first row of every region; regions that run further are cut off.details, extra lines added to each review request, such as a schema path or version.scope, text for a checkbox reviewers can tick to say a request applies more widely, for exampleApply to every version of this schema.
The page states each map's title once, and captions each image with its sheet, its number of regions and any preview limit. The PNGs hold only the sheet, so they can be used on their own.
To put several workbooks on one page, list them under maps:, with an optional page title:
title: Lab reports
maps:
- {workbook: january.xlsx, regions: [...]}
- {workbook: february.xlsx, regions: [...]}
You can also pass several map files: sheetmap a.yaml b.yaml -o reports.html.
Lay out the page
Every image has two dimensions: the map it belongs to and the sheet it shows. A layout
block in the map file says which dimension forms the sections of the page, which forms the rows and
which forms the columns. Each dimension can be used once.
layout:
sections: sheet # auto (the default), none, map or sheet
rows: sheet # map or sheet
columns: map # map or sheet
wrap: 3 # flow into this many columns when rows and columns are not set
fit: true # scale grids to the window
Some useful layouts:
| Layout | Result |
|---|---|
| (none) | A section per map, with its sheets side by side while they fit |
columns: map |
A section per sheet, with a column per map lined up down the page; good for comparing examples |
columns: sheet |
A section per map, with a column per sheet lined up down the page |
rows: sheet, columns: map |
One table: a row per sheet, a column per map, with headings on both |
sections: none, wrap: 3 |
Every image in one grid, three to a row |
sections: auto uses whichever dimension the rows and columns leave free. When only one of rows
and columns is set and a dimension is left over, it fills the other axis. A position with no image,
such as a map without that sheet, shows a placeholder.
Images keep their full size by default, and a wide grid scrolls sideways. With fit: true, a grid
shares the window between its columns in proportion to their full widths, so every image is scaled by
the same amount and text stays the same size across the page. Images are never enlarged. Images that
flow, without rows, columns or wrap, always keep their full size.
To place images by hand, give cells instead: rows of map/sheet references, where map is a map's
key or title. Use null to leave a gap. Images you do not reference are left out.
layout:
cells:
- [January/Report, February/Report]
- [January/Raw_Data, null]
examples/lab/compare.yaml compares January and February examples of the same report with
columns: map, and uses YAML anchors so both months share one list of regions:
uv run sheetmap examples/lab/compare.yaml
The command line overrides the file's layout: --sections, --rows, --columns, --wrap N and
--fit/--no-fit. Giving --rows, --columns or --wrap replaces the file's arrangement:
uv run sheetmap examples/lab/compare.yaml --rows sheet --columns map --fit
Review mappings
Review tools are off by default. Turn them on with --review, or review: true in the map file;
--no-review overrides the file.
uv run sheetmap examples/lab/map.yaml --review
Each label then opens a dialogue for marking the range for removal or proposing a replacement, with a note. Review summary collects the requests as text to copy. Requests are kept in the browser's storage where it is available, and they change nothing in the workbooks or maps.
Output
sheetmap MAP writes MAP.html beside the map, unless you give -o or --output. Beside it,
MAP_assets/ holds a PNG per sheet and manifest.json, which lists each image with its regions,
their resolved areas and their axis labels.
- Only sheets with regions are drawn.
- Formula cells show the values Excel last saved; nothing is recalculated.
- Charts and images in the workbook are not drawn.
- Workbooks are opened for reading and never saved.
- An existing HTML file is replaced only if sheetmap wrote it. PNGs from earlier runs with other names are left in place.
Without --review the page has no script. The page and PNGs contain the workbooks' contents, so share
them only with people who may see that data.
Use from Python
from sheetmap import Layout, Preview, Region, SheetMap, render
render(
[
SheetMap(
"january.xlsx",
[
Region("patient", "Report!B3"),
Region("results", "Report!A7:D", columns={"A": "sample_id", "C": "analyte", "D": "value"}),
],
title="Lab report",
preview={"Raw_Data": Preview(rows=40, columns=20)},
)
],
"maps.html",
layout=Layout(columns="map"),
review=False,
)
sheetmap.check(maps) checks maps against their workbooks without writing anything, and
sheetmap.load_map_file(path) reads a map file into a MapFile holding its maps and page settings. Problems raise sheetmap.SheetmapError.
Development
make install # uv sync
make test
make lint
scripts/build_example.py rebuilds the example workbooks.
Text is drawn with DejaVu Sans or Arial when the system has one, and Pillow's built-in font otherwise, so images can differ slightly between machines.
Releasing
Versions come from git tags. To release from a clean main:
make release-check VERSION=0.1.0 # build locally at that version without tagging
make release VERSION=0.1.0 # tag v0.1.0 and push it
Pushing the tag runs the publish workflow. It reruns CI, builds the sdist and wheel, uploads them to
PyPI through trusted publishing (the pypi environment), and creates a GitHub release with the
built files attached.
Metadata
Release files for sheetmap 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sheetmap-0.1.0.tar.gz | 42.3 kB | With provenance | Details for sheetmap-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sheetmap-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for sheetmap-0.1.0-py3-none-any.whl |
Total release size: 71.0 kB
Release files / sheetmap-0.1.0.tar.gz
| Download URL | sheetmap-0.1.0.tar.gz |
|---|---|
| Size | 42.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ee0af8fc65acad83b7ea3702c2b56146a43ee9fbba5163bfca171a6626c6ae9
|
|
BLAKE2b-256 checksum How to use checksums |
335a7f5d93cb4e6da8adcbe0c4f71f1f2e250c4badb94a5ecccd2eed5ff54a03
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / sheetmap-0.1.0-py3-none-any.whl
| Download URL | sheetmap-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf1967f57a0d645c2ac409c671d75767c4fc5e87fb9fd6eb5221283903f051ea
|
|
BLAKE2b-256 checksum How to use checksums |
50a9c217ad05c358b49b3abdcf93864ada35c813d45f6dce8956e47832a203a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for sheetmap 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sheetmap-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.