merton.excel.installer

Sideload-directory installer for the Office.js manifest.

Excel reads Office.js add-in manifests from a platform-specific sideload directory:

  • macOS: ~/Library/Containers/com.Microsoft.Excel/Data/Documents/wef

  • Windows: %LOCALAPPDATA%\Microsoft\Office\16.0\Wef

  • Linux: not supported (Excel itself is unavailable; users on Linux need Excel for the web and a manual upload).

This module writes the manifest XML to the right place; users can also just install via Excel’s Upload My Add-in UI by pointing at any local path.

Attributes

Functions

sideload_directory(→ pathlib.Path)

Best-effort detection of Excel's sideload directory for this OS.

install(→ pathlib.Path)

Write the manifest into the sideload directory. Returns its path.

uninstall(→ bool)

Remove the manifest. Returns True if a file was actually deleted.

is_installed(→ bool)

Whether the manifest is currently in the sideload directory.

Module Contents

merton.excel.installer.MANIFEST_FILENAME: Final[str] = 'merton-manifest.xml'[source]
merton.excel.installer.sideload_directory() pathlib.Path[source]

Best-effort detection of Excel’s sideload directory for this OS.

merton.excel.installer.install(*, base_url: str = 'http://localhost:8000', sideload_dir: pathlib.Path | None = None) pathlib.Path[source]

Write the manifest into the sideload directory. Returns its path.

merton.excel.installer.uninstall(*, sideload_dir: pathlib.Path | None = None) bool[source]

Remove the manifest. Returns True if a file was actually deleted.

merton.excel.installer.is_installed(*, sideload_dir: pathlib.Path | None = None) bool[source]

Whether the manifest is currently in the sideload directory.