Client API

Http client

class EodDataHttpClient(username, password, base_url='http://ws.eoddata.com/data.asmx/', max_login_retries=3, logger=None)[source]

EodData web service client.

Endpoints:
  • CountryList - country_list;
  • DataClientLatestVersion - data_client_latest_version;
  • DataFormats - data_formats;
  • ExchangeGet - exchange_detail;
  • ExchangeList - exchange_list;
  • ExchangeMonths - exchange_months;
  • FundamentalList - fundamental_list;
  • Login - login;
  • NewsList - news_list;
  • NewsListBySymbol - news_list_by_symbol;
  • QuoteGet - quote_detail;
  • QuoteList - quote_list;
  • QuoteList2 - quote_list_specific;
  • QuoteListByDate - quote_list_by_date;
  • QuoteListByDate2 - quote_list_by_date_compact;
  • QuoteListByDatePeriod - quote_list_by_date_period;
  • QuoteListByDatePeriod2 - quote_list_by_date_period_compact;
  • SplitListByExchange;
  • SplitListBySymbol;
  • SymbolChangesByExchange;
  • SymbolChart;
  • SymbolGet;
  • SymbolHistory - symbol_history;
  • SymbolHistoryPeriod - symbol_history_period;
  • SymbolHistoryPeriodByDateRange - symbol_history_period;
  • SymbolList - symbol_list;
  • SymbolList2 - symbol_list_compact;
  • TechnicalList;
  • Top10Gains;
  • Top10Losses;
  • UpdateDataFormat;
  • ValidateAccess.
country_list()[source]

Returns a list of available countries.

Returns:
[(‘AF’, ‘Afghanistan’), (‘AL’, ‘Albania’), (‘DZ’, ‘Algeria’),
(‘AS’, ‘American Samoa’), (‘AD’, ‘Andorra’), (‘AO’, ‘Angola’)]
Return type:List of tuples with country code and country name. For example
data_client_latest_version()[source]

Returns the latest version information of Data Client.

Returns:
String with the latest version of data client in format
”MAJOR.MINOR.PATCH.HOTFIX”.
data_formats()[source]

Returns the list of data formats.

exchange_detail(exchange_code)[source]

Get detailed information about an exchange.

Returns:EodDataExchange or None
exchange_list(output_format='entity-list')[source]

Get all available exchanges.

Returns:EodData exchanges.
Return type:list or pandas.DataFrame
exchange_months()[source]

Returns the number of Months history a user is allowed to download.

fundamental_list()[source]

Returns a complete list of fundamental data for an entire exchange.

get_params(additional=None)[source]

Get dictionary with parameters for a request.

Parameters:additional (dict or None) – Additional parameters for a request.
Returns:Dictionary with parameters for a request.
login()[source]
Login to EODData Financial Information Web Service.
Used for Web Authentication.
Returns:bool, whether authentication was successful or not.
news_list(exchange_code)[source]

Returns a list of News articles for an entire exchange.

news_list_by_symbol(exchange_code)[source]

Returns a list of News articles for a given Exchange and Symbol.

process_response(response)[source]
Process response from EodData web service. All responses from
EodData web service have common format. This method is kind of a wrapper to process all responses.
Parameters:

response (requests.Response) – Response that comes from EodData web service.

Returns:

bool, True - success, False - expired / invalid token

Raises:
  • InvalidExchangeCode, InvalidSymbolCode, EodDataInternalServerError,
  • NoDataAvailableError
quote_detail(exchange_code, symbol)[source]

Get an end of day quote for a specific symbol.

Returns:EodDataQuoteExtended or None.
quote_list(exchange_code, output_format='entity-list')[source]

Get a complete list of end of day quotes for an entire exchange.

Parameters:exchange_code (str) – Exchange code.
Returns:EodData extended quotes.
Return type:list or pandas.DataFrame
quote_list_by_date(exchange_code, date, output_format='entity-list')[source]
Get a complete list of end of day quotes for an entire exchange
and a specific date.
Parameters:
  • exchange_code – Exchange code.
  • date (datetime.date) – Date.
Returns:

EodData extended quotes

Return type:

list or pandas.DataFrame

quote_list_by_date_compact(exchange_code, date, output_format='entity-list')[source]
Get a complete list of end of day quotes for an entire exchange
and a specific date (compact format).
Returns:EodData compact quotes
Return type:list or pandas.DataFrame
quote_list_by_date_period(exchange_code, date, period, output_format='entity-list')[source]
Get a complete list of end of day quotes for an entire exchange
and a specific date (compact format).
Returns:EodData extended quotes
Return type:list or pandas.DataFrame
quote_list_by_date_period_compact(exchange_code, date, period, output_format='entity-list')[source]
Get a complete list of end of day quotes for an entire exchange
and a specific date (compact format).
Parameters:
  • exchange_code (str) – Exchange code.
  • date (datetime.date) – Date.
  • period (str) – Period code.
Returns:

EodData compact quotes.

Return type:

list or pandas.DataFrame

quote_list_specific(exchange_code, symbol_list, output_format='entity-list')[source]

Get end of day quotes for specific symbols.

Parameters:
  • exchange_code (str) – Exchange code.
  • symbol_list (list of str) – Symbol list.
Returns:

EodData extended quotes.

Return type:

list or pandas.DataFrame

retry(func, *args, **kwargs)[source]

Try to get a new token and call function one more time

Parameters:func – Function to retry
Returns:Result of func() call
retry_limit(func)[source]

Decorator to have control over retry count.

Returns:Wrapped function.
Raises:ReloginDepthReachedError
symbol_history(exchange_code, symbol, start_date, output_format='entity-list')[source]
Get a list of historical end of day data of a specified symbol
and specified start date up to today’s date.
Parameters:
  • exchange_code (str) – Exchange code.
  • symbol (str) – Symbol.
  • start_date (datetime.date) – Start date.
Returns:

EodData extended quotes.

Return type:

list or pandas.DataFrame

symbol_history_period(exchange_code, symbol, date, period, output_format='entity-list')[source]
Get a list of historical data of a specified symbol, specified date
and specified period.
Parameters:
  • exchange_code (str) – Exchange code.
  • symbol (str) – Symbol.
  • date (datetime.date) – Date.
  • period (str) – Period code.
Returns:

EodData extended quotes.

Return type:

list or pandas.DataFrame

symbol_history_period_by_range(exchange_code, symbol, start_date, end_date, period, output_format='entity-list')[source]
Get a list of historical data of a specified symbol,
specified date range and specified period.
Parameters:
  • exchange_code (str) – Exchange code.
  • symbol (str) – Symbol.
  • start_date (datetime.date) – Period start.
  • end_date (datetime.date) – Period end.
  • period (str) – Period code.
Returns:

EodData extended quotes.

Return type:

list or pandas.DataFrame

symbol_list(exchange_code, output_format='entity-list')[source]

Get a list of symbols of a specified exchange.

Parameters:exchange_code (str) – Exchange code.
Returns:list or pandas.DataFrame
symbol_list_compact(exchange_code, output_format='entity-list')[source]

Get a list of symbols (compact format) of a specified exchange.

Parameters:exchange_code (str) – Exchange code.
Returns:list or pandas.DataFrame

Errors

class Error[source]

Base error for this module.

class TestEnvironmentNotSet[source]

Test environment variables not set.

class InvalidTokenError[source]

Request was sent with invalid token.

class InvalidExchangeCodeError[source]

Error trying to get data for unknown exchange.

class InvalidSymbolCodeError[source]

Error trying to get data for unknown symbol.

class InvalidCredentialsError[source]

Error trying to login with invalid credentials.

class NoDataAvailableError[source]

Error trying to access unavailable data

class EodDataInternalServerError[source]

Internal server error occurred when requesting data from EodData wev service.

class ReloginDepthReachedError[source]

Relogin depth reached.

class AccessLimitError[source]

Error trying to access data beyond available subscription.