Skip to main content

sumoffice for Python

Open, edit, recalculate and save Excel workbooks, read Word documents and add slides to PowerPoint decks from Python. The package ships the native SumSheet, SumDoc and SumSlide cores inside the wheel: nothing is compiled on install, and you need neither Microsoft Office, LibreOffice nor a document server.

pip install sumoffice

Wheels exist for macOS (Apple silicon and Intel), Linux x86-64 and aarch64 (glibc 2.28 or newer) and Windows x64, for Python 3.10 and newer.

First result in five lines

import sumoffice

wb = sumoffice.open("report.xlsm")
wb["Cash flow"]["B7"] = 42
wb.save("report-edited.xlsm")

The VBA project, Power Query parts and images stay in the saved file byte for byte; sumoffice never rewrites parts it did not change.

Three examples

1. Change a cell in a macro workbook and keep the macros

import sumoffice

wb = sumoffice.open("budget.xlsm")
print(wb.sheet_names)                 # ('Cash flow', 'Summary')
wb["Cash flow"]["B7"] = 42            # number, text, None, or a formula "=B5*2"
wb.save("budget-edited.xlsm")         # vbaProject.bin is kept as it was

2. Recalculate and read the results back

import sumoffice

wb = sumoffice.open("model.xlsx")
sheet = wb["Summary"]
sheet["A1"] = 1200
sheet["A2"] = "=A1*1.2"
wb.recalc()
print(sheet["A2"])                    # 1440
print(sheet.formula("A2"))            # '=A1*1.2'
print(sheet.read("A1:B3"))            # [[1200, None], [1440, None], [None, None]]
wb.save("model-edited.xlsx")

again = sumoffice.open("model-edited.xlsx")
assert again["Summary"]["A2"] == 1440

3. Read the text of a Word document; add a slide to a deck

import sumoffice

print(sumoffice.text("contract.docx"))

deck = sumoffice.open("deck.pptx")
deck.add_slide()
print(deck.slide_count)
deck.save("deck-edited.pptx")

Use it from Claude Desktop, Cursor or another MCP client

The package includes a local MCP server that works only with files on your computer. Nothing is sent anywhere.

{
  "mcpServers": {
    "sumoffice": { "command": "/full/path/to/venv/bin/sumoffice-mcp" }
  }
}

Desktop apps do not read your shell's PATH, so give the full path: run which sumoffice-mcp (Windows: where sumoffice-mcp) in the environment where you installed the package. In Claude Desktop the file is claude_desktop_config.json (Settings → Developer → Edit Config); restart the app after saving.

Tools: open_workbook, read_range, write_cells, recalc, save_copy, document_text. By default the server reads files under your home directory; set SUMOFFICE_MCP_ROOTS (paths separated by the OS path separator) to allow other folders. save_copy never overwrites the source file.

What is free

Without a key With a developer key
Documents per day 200 10,000
Term no expiry 90 days from issue
When the quota is used up LicenseQuotaError right away, with a link to the key page; no waiting, no slowdown the same

A document counts once per opening, however many cells you change. Request a developer key at https://sumoffice.com/python#developer-key. Put the key in SUMOFFICE_LICENSE, or the path to the key file in SUMOFFICE_LICENSE_FILE.

The daily quota is enforced by the Word core today. The spreadsheet and presentation cores do not count documents yet, so their use is currently not limited.

What it does not do

  • It does not run VBA macros; it keeps them.
  • XLSX to PDF conversion and page previews are not in this wheel yet: sumoffice.convert() and sumoffice.preview() raise CapabilityUnavailableError and create no file.
  • Word support is read-only in the high-level API (sumoffice.text); editing goes through the low-level Session.
  • The Word core uses system fonts. On a server without fonts set FASTDOC_FONT_DIR to a folder with the document's fonts for stable layout.
  • A wheel works only on the operating system and CPU named in its file name.
  • Error messages are in Russian in this release.

Low level

sumoffice.Session opens a document in one core and accepts the core's own JSON commands. Engines are called "sheet", "doc" and "slide" (the names "sumsheet", "sumdoc" and "sumslide" also work). Call session.handshake() to see the operations a core supports.

Documentation and support

Metadata

Release files for sumoffice 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for sumoffice 0.2.0
File Actions
sumoffice-0.2.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for sumoffice-0.2.0-py3-none-win_amd64.whl
sumoffice-0.2.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for sumoffice-0.2.0-py3-none-manylinux_2_28_x86_64.whl
sumoffice-0.2.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for sumoffice-0.2.0-py3-none-manylinux_2_28_aarch64.whl
sumoffice-0.2.0-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for sumoffice-0.2.0-py3-none-macosx_11_0_x86_64.whl
sumoffice-0.2.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for sumoffice-0.2.0-py3-none-macosx_11_0_arm64.whl

Total release size: 228.5 MB

Release files / sumoffice-0.2.0-py3-none-win_amd64.whl

Download URL sumoffice-0.2.0-py3-none-win_amd64.whl
Size 46.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
499e5e6e5ffdc8adfff711c551c7d5ddaefe2c2e8f08aac48b423deec76e81f2
BLAKE2b-256 checksum
How to use checksums
b6eeaf6e404c99261529a1bab8fa3dec4c74595bbb433a5257bda3e01c41a257
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / sumoffice-0.2.0-py3-none-manylinux_2_28_x86_64.whl

Download URL sumoffice-0.2.0-py3-none-manylinux_2_28_x86_64.whl
Size 46.6 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
811b439bf19e0cc8b2cd7c0bb470f50c157d8ae1fff8ba3f294b214d1799393d
BLAKE2b-256 checksum
How to use checksums
5b8d57e35a12855b8bf9118a1b67df0ce7d1b0c1bd9da7e50832ae3780611c5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / sumoffice-0.2.0-py3-none-manylinux_2_28_aarch64.whl

Download URL sumoffice-0.2.0-py3-none-manylinux_2_28_aarch64.whl
Size 42.8 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
98167073ae478e69e210d7c39d0f390d50d7d90b558d7120b1f35288754c81ec
BLAKE2b-256 checksum
How to use checksums
2f038d8518731da5fda8fc5c162e3a2d51e1a34399ba256913dc0523ee8f13e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / sumoffice-0.2.0-py3-none-macosx_11_0_x86_64.whl

Download URL sumoffice-0.2.0-py3-none-macosx_11_0_x86_64.whl
Size 47.6 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
cebaee8188440ca977888ccf3099ab9c99947e23bee1f042635ba4f424d9ebd8
BLAKE2b-256 checksum
How to use checksums
c334a868c9c7824e633df69e8dd917429ee6376457b8769cc93385f7383afbf8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / sumoffice-0.2.0-py3-none-macosx_11_0_arm64.whl

Download URL sumoffice-0.2.0-py3-none-macosx_11_0_arm64.whl
Size 45.1 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a0ec6fddce331f4ca4a0ebdc5febdcd8ab63e8bb0282172903ff19c2f34b7daf
BLAKE2b-256 checksum
How to use checksums
5dc62cba15fd091be023804c599eff05b5e4cafeb3d1832666d9ddb10f010879
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.12.14

Security for sumoffice 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page