# coding=utf-8
import json
from os.path import join, dirname
from watson_developer_cloud import DocumentConversionV1 as DocumentConversion


document_conversion = DocumentConversion(username='******',
                                         password='******')

with open(join(dirname(__file__), '../resources/sample-docx.docx'), 'rb') as document:
    config = {'conversion_target': DocumentConversion.ANSWER_UNITS}
    print(json.dumps(document_conversion.convert_document(document=document, config=config), indent=2))
Beispiel #2
0
# coding=utf-8
import json
from os.path import join, dirname
from watson_developer_cloud import DocumentConversionV1 as DocumentConversion

document_conversion = DocumentConversion(username='******',
                                         password='******')

# print(json.dumps(document_conversion.get_jobs(), indent=2))

with open(join(dirname(__file__), '../resources/sample-docx.docx'),
          'rb') as document:
    config = {'conversion_target': DocumentConversion.ANSWER_UNITS}
    print(
        json.dumps(document_conversion.convert_document(document=document,
                                                        config=config),
                   indent=2))
Beispiel #3
0
# coding=utf-8
import json
from os.path import join, dirname
from watson_developer_cloud import DocumentConversionV1 as DocumentConversion

document_conversion = DocumentConversion(username='******',
                                         password='******',
                                         version='2016-02-09')

with open(join(dirname(__file__), '../resources/example.html'),
          'r') as document:
    config = {'conversion_target': DocumentConversion.ANSWER_UNITS}
    print(
        json.dumps(document_conversion.convert_document(
            document=document, config=config, media_type='text/html'),
                   indent=2))
# coding=utf-8
import json
from os.path import join, dirname
from watson_developer_cloud import DocumentConversionV1 as DocumentConversion


document_conversion = DocumentConversion(username='******',
                                         password='******',
                                         version='2016-02-09')

with open(join(dirname(__file__), '../resources/example.html'), 'r') as document:
    config = {'conversion_target': DocumentConversion.ANSWER_UNITS}
    print(json.dumps(document_conversion.convert_document(document=document, config=config, media_type='text/html'),
                     indent=2))