Skip to content

Commit ec90328

Browse files
committed
updating document conversion conversion target casing
1 parent ffebba9 commit ec90328

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

watson_developer_cloud/document_conversion_v1.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323

2424
class DocumentConversionV1(WatsonDeveloperCloudService):
2525
DEFAULT_URL = 'https://gateway.watsonplatform.net/document-conversion/api'
26-
ANSWER_UNITS = 'ANSWER_UNITS'
27-
NORMALIZED_HTML = 'NORMALIZED_HTML'
28-
NORMALIZED_TEXT = 'NORMALIZED_TEXT'
26+
ANSWER_UNITS = 'answer_units'
27+
NORMALIZED_HTML = 'normalized_html'
28+
NORMALIZED_TEXT = 'normalized_text'
2929
latest_version = '2016-02-10'
3030

3131
def __init__(self, version, url=DEFAULT_URL, **kwargs):
@@ -47,10 +47,10 @@ def index_document(self, config, document=None, metadata=None, media_type=None):
4747
raise AssertionError('Missing required parameters: document or metadata. At least one of those is required.')
4848
params = {'version': self.version}
4949
files = [('config', ('config.json', json.dumps(config), 'application/json'))]
50-
if document != None:
50+
if document is not None:
5151
filename = os.path.basename(document.name)
5252
file_tuple = (filename, document, media_type) if media_type else (filename, document)
5353
files.append(('file', file_tuple))
54-
if metadata != None:
54+
if metadata is not None:
5555
files.append(('metadata', ('metadata.json', json.dumps(metadata), 'application/json')))
5656
return self.request(method='POST', url='/v1/index_document', files=files, params=params, accept_json=True)

0 commit comments

Comments
 (0)