{"id":24640,"library":"spire-doc","title":"Spire.Doc for Python","description":"Spire.Doc for Python is a standalone Word Python API for creating, reading, manipulating, and converting Word documents (DOC, DOCX, RTF, etc.) without Microsoft Office. Version 14.4.2 is current; major version bumps occur roughly every 3-6 months, often introducing breaking changes in API paths.","status":"active","version":"14.4.2","language":"python","source_language":"en","source_url":"https://github.com/e-iceblue/spire-doc-python","tags":["word","docx","document","spire","office"],"install":[{"cmd":"pip install spire.doc","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for .NET interoperability on Windows; macOS/Linux may need alternative configuration.","package":"pythonnet","optional":true}],"imports":[{"note":"Old import paths from earlier versions (v3.x) used different class names.","wrong":"from spire.doc import SpireDoc","symbol":"Document","correct":"from spire.doc import Document"},{"note":"In v12+, constants moved; direct import from spire.doc is required.","wrong":"from spire.doc.common import FileFormat","symbol":"FileFormat","correct":"from spire.doc import FileFormat"}],"quickstart":{"code":"from spire.doc import Document, FileFormat\n\ndoc = Document()\nsection = doc.AddSection()\nparagraph = section.AddParagraph()\nparagraph.AppendText(\"Hello, Spire.Doc!\")\ndoc.SaveToFile(\"output.docx\", FileFormat.Docx)\ndoc.Close()","lang":"python","description":"Creates a simple Word document with one paragraph and saves as DOCX. No license file required for free tier (limited to sections/pages)."},"warnings":[{"fix":"Use explicit imports: `from spire.doc import Document, FileFormat, TextAlignment, etc.`","message":"From v12.0 onward, import paths changed significantly. Old patterns like `from spire.doc import *` or `from spire.doc.common import *` are deprecated.","severity":"breaking","affected_versions":">=12.0"},{"fix":"Replace with `FileFormat.Docx` or `FileFormat.Doc`.","message":"The methods `Document.SaveToFile()` with `FileFormat.Docx2010` and similar version-specific enums are deprecated in favor of generic `FileFormat.Docx`.","severity":"deprecated","affected_versions":">=13.0"},{"fix":"Check with `doc.PageCount` in development or purchase a license to remove limitations.","message":"The free version has a page/section limit (typically 3 pages). Exceeding causes silent truncation or exceptions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install using `pip install spire.doc`. Ensure no typos.","cause":"The package is installed as `spire.doc` but import is case-sensitive.","error":"ModuleNotFoundError: No module named 'spire.doc'"},{"fix":"Use `from spire.doc import Document` (not `from spire.doc import SpireDoc` or `import spire.doc`).","cause":"Using old import pattern or missing correct import path.","error":"AttributeError: module 'spire.doc' has no attribute 'Document'"},{"fix":"Replace with `FileFormat.Docx` (without version number).","cause":"Version-specific file format enums removed in v13+.","error":"FileFormat' object has no attribute 'Docx2010'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}