For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
13 4 4 11

Disable printing error message from Python API

I was requesting time series tick data using Python API. Whenever there is no data in the provided time range, the API itself prints out the error message "Error with MFRISCOA1.MX: No data available for the requested date range". How can I disable the API printing such error messages?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
39.2k 75 11 27

The error message comes from the logging that Eikon Data APIs for Python library implements. You can suppress the logging of errors by setting the log level to a value that ensures errors and warnings are ignored:

import logging
eikonLogger = logging.getLogger('pyeikon')
eikonLogger.setLevel(logging.FATAL)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea