Document editor REST API to edit popular document formats using any WYSIWYG HTML editor without asking to install external applications.
Start Free TrialGroupDocs.Editor Cloud SDK for Python makes it easier for developers to incorporate document editing features within Python based applications by integrating it with GroupDocs.Editor Cloud REST API. Perform advanced document editing operations by simply fetching the supported document types (Microsoft Word, Excel spreadsheets, PowerPoint, TXT, HTML, XML) in any front-end HTML editor using GroupDocs.Editor Cloud API and save it back to original document format after editing the document.
GroupDocs.Editor Cloud SDK for Python is built as a layer on top of GroupDocs.Editor Cloud REST API that saves valuable development time by managing low-level requests and handling responses. The developers can focus on writing up the specific code only as needed in the project.
Check out GroupDocs.Editor Cloud SDK for Python at GitHub if you are looking for the source code to annotate file in the Cloud.
You can try GroupDocs.Editor Low-Code Python APIs without any limitations.
GroupDocs.Editor Cloud is also available as Docker image which can be used to self-host the service. Or you may build your own services using GroupDocs.Editor High-code APIs which currently drive our REST APIs.
//Get your App SID, App Key and Storage Name at https://dashboard.groupdocs.cloud (free registration is required).
editApi = groupdocs_editor_cloud.EditApi.from_keys(app_sid, app_key)
fileApi = groupdocs_editor_cloud.FileApi.from_keys(app_sid, app_key)
# The document already uploaded into the storage.
# Load it into editable state
fileInfo = groupdocs_editor_cloud.FileInfo("WordProcessing/password-protected.docx", None, None, "password")
loadOptions = groupdocs_editor_cloud.WordProcessingLoadOptions()
loadOptions.file_info = fileInfo
loadOptions.output_path = "output"
loadResult = editApi.load(groupdocs_editor_cloud.LoadRequest(loadOptions))
# Download html document
htmlFile = fileApi.download_file(groupdocs_editor_cloud.DownloadFileRequest(loadResult.html_path))
html = ""
with open(htmlFile, 'r') as file:
html = file.read()
# Edit something...
html = html.replace("Sample test text", "Hello world")
# Upload html back to storage
with open(htmlFile, 'w') as file:
file.write(html)
fileApi.upload_file(groupdocs_editor_cloud.UploadFileRequest(loadResult.html_path, htmlFile))
# Save html back to docx
saveOptions = groupdocs_editor_cloud.WordProcessingSaveOptions()
saveOptions.file_info = fileInfo
saveOptions.output_path = "output/edited.docx"
saveOptions.html_path = loadResult.html_path
saveOptions.resources_path = loadResult.resources_path
saveResult = editApi.save(groupdocs_editor_cloud.SaveRequest(saveOptions))
# Done
print("Document edited: " + saveResult.path)