Open, generate, edit, split, merge, compare and convert a Word document in Python. It's easy for Python developers to manipulate Microsoft Word documents.
Simply integrate our Cloud API into your applications or Django framework to work with your documents. Use templates to generate documents. We provide a REST API for converting documents in PDF, images and other supported file formats.
While working with documents and files, how many times did you ask Google "How to convert Word documents to text files with Python" or "How to extract data from Word documents using Python"?
How many times did you want to find an easy, free and online tool to help you to create and update Microsoft Word DOCX files?
Our Cloud API for Python will answer all your questions and make working with documents much easier.
Document Properties, Protection, Tracking of Changes
Watermarks
Create, Merge & Split Documents
Compare & Render Documents
Convert with a high quality rendering. 20+ document formats are supported
Headers, Footers & Sections
Text Search & Replace
Paragraphs
Fields
Form Fields
MailMerge and Report Generation
Files & Storage, Ranges, Drawing Objects
Plugins for WordPress, SalesForce, Dynamics CRM & Drupal
Python 2.7 & 3.5
You can both read and write documents in: DOCX, DOC, PDF, MD, RTF, DOCM, DOTX, DOT, DOTM, ODT, OTT, XML, HTML, MHTML, XHTML, TXT.
The write-only formats are: XPS, OpenXPS, PS, JPEG, PNG, BMP, SVG, TIFF, EMF, PCL, EPUB.
The read-only formats are: MOBI, CHM.
For more details, please check Supported File Formats.
Our Cloud API is designed to create, open, edit, split, merge, compare and convert a Word document.
Aspose.Words Cloud Python SDK is a Python library that provides full control of MS Word documents. The library handles all elements of MS Word documents such as text, images, annotations, bookmarks, tables, hyperlinks, shapes, etc. You can execute any operation on these elements by using REST API.
You can work with text, page numbering, headers & footers, paragraphs and other document elements programmatically.
You can use mail merge, modify text, edit footnotes, bookmarks, comments, protect, draw objects and watermarks in DOCX documents with Python.
Aspose Cloud provides a powerful file conversion, splitting, merging, editing REST API.
Python developers can easily integrate Python API in their applications or Django framework to handle documents.
Using Python you can edit an existing Word document to correct spellings or add new content to a file. Also, it's used to access and to modify document elements as well as their formatting.
It allows you to use standard or more complex mail merge operations such as inserting images or repeatable regions in reports.
You can use templates for report generation in Word and then populate documents with XML or JSON data files.
You can use the tabular form, lining up with rows and columns.
You can add or delete the table from a Word document to extract the table information from a Word document.
It allows you to add/remove any existing watermark in a Word document. For example, you can execute following operations:
The following code sample shows how to convert PDF to DOCX in the Cloud and save the result to a local file:
from asposewordscloud import WordsApi
from asposewordscloud.models.requests import ConvertDocumentRequest
app_sid = '####-####-####-####-####'
app_key = '##################'
words_api = WordsApi(app_sid, app_key)
with open('sample.pdf', 'rb') as f:
request = ConvertDocumentRequest(f, format='docx')
result = words_api.convert_document(request)
print('Output filename: {}'.format(result))
apiKey = '####'
appSid = '####-####-####-####-####'
# Initialize Aspose.Storage SDK
storage_apiClient = asposestoragecloud.ApiClient.ApiClient(apiKey, appSid, True)
storageApi = StorageApi(storage_apiClient)
# Upload a file to Aspose Cloud Storage
filename = "Sample.docx"
with open(filename, 'rb') as f:
fileData = f.read()
storageApi.put_create(filename, fileData)
You can convert a Word document to desired file format in two ways, directly in a request body or convert existing file in the Storage.
# Suppose we have 'Sample.docx' in the Storage
save_options = SaveOptionsData(save_format='pdf', file_name='Sample.pdf', zip_output=True)
request = SaveAsRequest('Empty.docx', save_options)
result = words_api.save_as(request)
print("Result {}".format(result))
You can try and see the results of comparison using our free online tool.
# Suppose we uploaded 'Sample1.docx' and 'Sample2.docx' into the Storage
# And we want to compare and save results to the file 'Results.docx'
compare_data = CompareData('Sample2.docx', 'author', datetime.now())
request = CompareDocumentRequest('Sample1.docx', compare_data, dest_file_name='Results.docx')
result = words_api.compare_document(request)
print("Result {}".format(result))
request = CreateDocumentRequest(file_name="Blank.docx")
result = words_api.create_document(request)
print("Result {}".format(result))