diff --git a/qiskit_finance/data_providers/_base_data_provider.py b/qiskit_finance/data_providers/_base_data_provider.py index 480a05e..c293f51 100644 --- a/qiskit_finance/data_providers/_base_data_provider.py +++ b/qiskit_finance/data_providers/_base_data_provider.py @@ -10,7 +10,13 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. -"""This module implements the abstract base class for data_provider modules the finance module.""" +"""This module implements the abstract base class for data provider modules in the finance module. + +The module defines the :code:`BaseDataProvider` abstract class which should be inherited by any data +provider class within the finance module. It also includes the :code:`StockMarket` :code:`Enum` +representing supported stock markets. +""" + from __future__ import annotations from abc import ABC, abstractmethod from typing import cast @@ -27,7 +33,16 @@ class StockMarket(Enum): - """Enum representing various stock markets.""" + """:code:`Enum` representing various stock markets. + + This :code:`Enum` contains identifiers for the following stock markets, + represented by their respective codes: + + * :code:`"XLON"`: The London Stock Exchange. + * :code:`"XPAR"`: The Euronext Paris. + * :code:`"XSES"`: The Singapore Exchange. + + """ LONDON: str = "XLON" EURONEXT: str = "XPAR" diff --git a/qiskit_finance/data_providers/data_on_demand_provider.py b/qiskit_finance/data_providers/data_on_demand_provider.py index 5ac5f9d..2507c78 100644 --- a/qiskit_finance/data_providers/data_on_demand_provider.py +++ b/qiskit_finance/data_providers/data_on_demand_provider.py @@ -10,6 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +"""NASDAQ Data on demand data provider.""" + from __future__ import annotations import datetime from urllib.parse import urlencode @@ -44,10 +46,12 @@ def __init__( Args: token (str): Nasdaq Data Link access token. tickers (str | list[str] | None): Tickers for the data provider. - - If a string is provided, it can be a single ticker symbol or multiple symbols + + * If a string is provided, it can be a single ticker symbol or multiple symbols separated by semicolons or newlines. - - If a list of strings is provided, each string should be a single ticker symbol. - Default is :code:`None`. + * If a list of strings is provided, each string should be a single ticker symbol. + + Default is :code:`None`, which corresponds to no tickers provided. start (datetime.datetime): Start date of the data. Defaults to January 1st, 2016. end (datetime.datetime): End date of the data. diff --git a/qiskit_finance/data_providers/exchange_data_provider.py b/qiskit_finance/data_providers/exchange_data_provider.py index b017d81..b78a3c6 100644 --- a/qiskit_finance/data_providers/exchange_data_provider.py +++ b/qiskit_finance/data_providers/exchange_data_provider.py @@ -10,6 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +""" Exchange data provider. """ + from __future__ import annotations import logging import datetime @@ -47,10 +49,12 @@ def __init__( Args: token (str): Nasdaq Data Link access token. tickers (str | list[str] | None): Tickers for the data provider. - - If a string is provided, it can be a single ticker symbol or multiple symbols - separated by semicolons or new-lines. - - If a list of strings is provided, each string should be a single ticker symbol. - Default is :code:`None`. + + * If a string is provided, it can be a single ticker symbol or multiple symbols + separated by semicolons or newlines. + * If a list of strings is provided, each string should be a single ticker symbol. + + Default is :code:`None`, which corresponds to no tickers provided. stockmarket (StockMarket): LONDON (default), EURONEXT, or SINGAPORE start (datetime.datetime): Start date of the data. Defaults to January 1st, 2016. diff --git a/qiskit_finance/data_providers/random_data_provider.py b/qiskit_finance/data_providers/random_data_provider.py index 5a88766..f25576a 100644 --- a/qiskit_finance/data_providers/random_data_provider.py +++ b/qiskit_finance/data_providers/random_data_provider.py @@ -10,6 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +""" Pseudo-randomly generated mock stock-market data provider """ + from __future__ import annotations import datetime import logging @@ -31,13 +33,15 @@ def __init__( seed: int | None = None, ) -> None: """ - Initialize RandomDataProvider. + Initialize an instance of pseudo-randomly generated mock stock-market data provider. Args: tickers (str | list[str] | None): Tickers for the data provider. - - If a string is provided, it can be a single ticker symbol or multiple symbols + + * If a string is provided, it can be a single ticker symbol or multiple symbols separated by semicolons or newlines. - - If a list of strings is provided, each string should be a single ticker symbol. + * If a list of strings is provided, each string should be a single ticker symbol. + Default is :code:`None`, using :code:`["TICKER1", "TICKER2"]` if not provided. start (datetime.datetime): Start date of the data. Defaults to January 1st, 2016. diff --git a/qiskit_finance/data_providers/wikipedia_data_provider.py b/qiskit_finance/data_providers/wikipedia_data_provider.py index 1914526..7c57c60 100644 --- a/qiskit_finance/data_providers/wikipedia_data_provider.py +++ b/qiskit_finance/data_providers/wikipedia_data_provider.py @@ -10,6 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +"""Wikipedia data provider.""" + from __future__ import annotations import logging import datetime @@ -44,10 +46,12 @@ def __init__( token (str | None): Nasdaq Data Link access token. Default is None. tickers (str | list[str] | None): Tickers for the data provider. - - If a string is provided, it can be a single ticker symbol or multiple symbols + + * If a string is provided, it can be a single ticker symbol or multiple symbols separated by semicolons or newlines. - - If a list of strings is provided, each string should be a single ticker symbol. - Default is None, meaning no tickers provided. + * If a list of strings is provided, each string should be a single ticker symbol. + + Default is :code:`None`, which corresponds to no tickers provided. start (datetime.datetime): Start date of the data. Default is January 1st, 2016. end (datetime.datetime): End date of the data. @@ -70,8 +74,7 @@ def __init__( def run(self) -> None: """ Loads data from Wikipedia using Nasdaq Data Link API. - - This method retrieves stock market data from the Wikipedia dataset + Retrieves stock market data from the Wikipedia dataset using Nasdaq Data Link API, and populates the data attribute of the base class, enabling further calculations like similarity and covariance matrices. diff --git a/qiskit_finance/data_providers/yahoo_data_provider.py b/qiskit_finance/data_providers/yahoo_data_provider.py index 65f4665..d690434 100644 --- a/qiskit_finance/data_providers/yahoo_data_provider.py +++ b/qiskit_finance/data_providers/yahoo_data_provider.py @@ -10,6 +10,8 @@ # copyright notice, and modified files need to carry a notice indicating # that they have been altered from the originals. +""" Yahoo data provider. """ + from __future__ import annotations import datetime import logging @@ -49,10 +51,12 @@ def __init__( Args: tickers (str | list[str] | None): Tickers for the data provider. - - If a string is provided, it can be a single ticker symbol or multiple symbols + + * If a string is provided, it can be a single ticker symbol or multiple symbols separated by semicolons or newlines. - - If a list of strings is provided, each string should be a single ticker symbol. - Default is :code:`None`, meaning no tickers provided. + * If a list of strings is provided, each string should be a single ticker symbol. + + Default is :code:`None`, which corresponds to no tickers provided. start (datetime.datetime): Start date of the data. Default is January 1st, 2016. end (datetime.datetime): End date of the data.