merton.excel.manifest

Office.js add-in manifest XML generation.

Office.js (Excel for the web / Mac / Windows M365) sideloads add-ins via an XML manifest that describes the add-in’s identity, permissions, and the URLs to the JavaScript / functions / settings files. We generate this manifest at install time so it points at the user’s locally-running merton excel server.

The manifest schema is documented at https://learn.microsoft.com/en-us/javascript/api/manifest .

Functions

deterministic_add_in_id(→ str)

Generate a stable UUID derived from base_url so re-installing the

render_manifest(→ str)

Render the Office.js add-in manifest XML.

write_manifest(→ pathlib.Path)

Write the manifest to disk and return the resulting Path.

Module Contents

merton.excel.manifest.deterministic_add_in_id(base_url: str) str[source]

Generate a stable UUID derived from base_url so re-installing the add-in for the same server URL keeps the same identity.

merton.excel.manifest.render_manifest(*, base_url: str = 'http://localhost:8000', version: str = '1.0.0.0', add_in_id: str | None = None) str[source]

Render the Office.js add-in manifest XML.

Parameters:
  • base_url – Where the merton excel server is reachable (default http://localhost:8000).

  • version – Four-part add-in version (Microsoft requires this exact format).

  • add_in_id – Optional override. Defaults to a deterministic UUID derived from base_url so the same server URL always produces the same manifest identity.

merton.excel.manifest.write_manifest(path: str | pathlib.Path, *, base_url: str = 'http://localhost:8000', version: str = '1.0.0.0') pathlib.Path[source]

Write the manifest to disk and return the resulting Path.