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 nor LibreOffice. To let people view and edit the documents in a browser, use SumOffice 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 30 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.1

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.1
File Actions
sumoffice-0.2.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for sumoffice-0.2.1-py3-none-win_amd64.whl
sumoffice-0.2.1-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for sumoffice-0.2.1-py3-none-manylinux_2_28_x86_64.whl
sumoffice-0.2.1-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for sumoffice-0.2.1-py3-none-manylinux_2_28_aarch64.whl
sumoffice-0.2.1-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for sumoffice-0.2.1-py3-none-macosx_11_0_x86_64.whl
sumoffice-0.2.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for sumoffice-0.2.1-py3-none-macosx_11_0_arm64.whl

Total release size: 229.2 MB

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

Download URL sumoffice-0.2.1-py3-none-win_amd64.whl
Size 46.6 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
8a00bd7e1b529b9122b4c02f0d48519a528faa3bc5c741208340faf6d622dcde
BLAKE2b-256 checksum
How to use checksums
a41b4e07a8e519fa5a877ec4c691e6d92831a91a487628c5e70d1b37172be9db
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.1-py3-none-manylinux_2_28_x86_64.whl

Download URL sumoffice-0.2.1-py3-none-manylinux_2_28_x86_64.whl
Size 46.7 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
55338d8553852db0a8de2f5c7a6c307979206be90ad9f728d7546179157763ec
BLAKE2b-256 checksum
How to use checksums
0d9fcf7852b3df4b4c395c70536e96244b55e495896219b882dcdbcde9ec505b
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.1-py3-none-manylinux_2_28_aarch64.whl

Download URL sumoffice-0.2.1-py3-none-manylinux_2_28_aarch64.whl
Size 43.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
dbb629fbc19256652c70eb78f6ce9ef8c03cd07db472db0b4113c6a3014ca819
BLAKE2b-256 checksum
How to use checksums
f739ad87f853f08424344d860dd95566e5d63024d1a36757a5755a066b814427
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.1-py3-none-macosx_11_0_x86_64.whl

Download URL sumoffice-0.2.1-py3-none-macosx_11_0_x86_64.whl
Size 47.8 MB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
f72cb26ebe276e40f3362d7a219ef83c52959ac3e9f0f97e1013908f417e6059
BLAKE2b-256 checksum
How to use checksums
906fa4ae28dd36a06eeb2411bab3a4fd5600901ddb67f96c6739b11925f52941
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.1-py3-none-macosx_11_0_arm64.whl

Download URL sumoffice-0.2.1-py3-none-macosx_11_0_arm64.whl
Size 45.2 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e0a24ac780ddb52fa4259acfe13def4c075c85c20c666a2879fe96a1d02f6e02
BLAKE2b-256 checksum
How to use checksums
3815d6aa50265614be624fc3962f80644b2c34fb999b5bed9ed378153e993889
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.1

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