Python Document Editor REST API & SDK

Document editor REST API to edit popular document formats using any WYSIWYG HTML editor without asking to install external applications.

Start Free Trial

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

Advanced Document Editor REST API Features

Integrates easily within any WYSIWYG editor

Edit Word documents as a whole or define pages range

Multi-tabbed spreadsheet editing is supported

Optimized memory usage for large CSV or TSV files

Extract document information (type, size, page count etc)

Cloud REST API to be used with any language or platform

Working with WordProcessing Documents - Python

  //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)

Support and Learning Resources

GroupDocs.Editor offers document viewing APIs for other popular development environments