Free Support Forum - aspose.cloud

Python examples to manipulate Word Documents - Aspose.Words Cloud SDK for Python

Are there any programming examples how to use the Python SDK together with the Words cloud service API?

Hi Andreas,

Sorry, Python SDK examples are not available in the Words documentation at the moment. We are in the process of revamping our Cloud API documentation and SDKs and these examples will also be added once the process is done. The process will be completed soon.

Can you please share which SDK examples do you want? We will share your required examples with you as soon as possible.

I am looking for a simple example to upload a DOCX file to the server and retrieving the converted result as HTML or something else.

Hi Andreas,

You can use the following SDK example for this purpose; output format can be passed to convert method.

from common import *<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

from storage import Folder

from words import WordsConverter

import json

import os

try:

os.system('cls')

# sepcify App SID

SaasposeApp.app_sid = "77******-1***-4***-****-************"

# sepcify App Key

SaasposeApp.app_key = "**************"

SaasposeApp.output_location = 'd:\\temp\\'

# specify product URI

Product.base_product_uri = 'http://api.aspose.com/v1.1'

# create Folder object

folder = Folder()

folder.upload_file("Sample.doc","c:\\Sample.doc","")

# create OcrExtractor object

extractor = WordsConverter("Sample.doc")

print extractor.convert("html")

#responseStream = Folder.getFolders(folder)

#jsonData = json.loads(responseStream)

#print jsonData

print 'Done'

except Exception, ex:

print type(ex) # the exception instance

print ex.args # arguments stored in .args

print ex.errno

print ex.strerror

finally:

raw_input("Press any Key")

Once revamp is done, updated examples will be available in the documentation and you will be able to download migrated SDK from https://github.com/aspose-words-cloud/aspose-words-cloud-python.

Please feel free to contact us in case you have further comments or questions.

Best Regards,

Hello-


Is this response still current? Or is there an updated Python API example?

thank you,
-e

Hi,

Python examples are available in the documentation now. Please check Aspose.Words documentation http://www.aspose.com/docs/display/wordscloud/Home for Aspose.Words examples.

Please feel free to contact us in case you have further comments or questions.

Best Regards,