stockbot package

Submodules

stockbot.sources module

The sources module provides functions and classes that are useful for:

  • obtaining price quotes for symbols
  • obtaining historical price information for symbols
  • looking up symbols
  • determining current market status (open/closed)
exception stockbot.sources.DataError(value)[source]

Bases: exceptions.Exception

Custom exception for data errors.

stockbot.sources.get_cnbc_quote(symbol)[source]

Gets a real-time price quote for :param:`symbol` from CNBC.

:param:`symbol` the ticker symbol of the instrument we want to price :type:`symbol` str :returns: MarketData object with labeled price data :rtype:`pd.Series` :raises:`IOError` :raises:`DataError` :raises:`ValueError` :raises:`AttributeError`

stockbot.sources.get_status_US()[source]

Get the open/closed status of markets in the United States.

Returns:a string with time remaining until close or None if closed
Return type:str or None

:raises:`IOError` :raises:`DataError` :raises:`ValueError` :raises:`AttributeError`

stockbot.sources.get_symbol(symbol)[source]

Gets a list of securities containing :param:`symbol`.

:param:`symbol` the symbol or name fragment to find :type:`search` str :returns: a MarketData obj generator of results :rtype: list :raises:`IOError` :raises:`DataError` :raises:`ValueError` :raises:`AttributeError`

stockbot.sources.get_yahoo_hist(symbol)[source]

Gets historical price data for :param:`symbol` from Yahoo! finance.

:param:`symbol` the ticker symbol of the instrument we want to price :type:`symbol` str :returns: a MarketData obj generator of labeled price data :rtype:`pd.DataFrame` :raises:`IOError` :raises:`DataError` :raises:`ValueError` :raises:`AttributeError`

stockbot.sources.get_yahoo_quote(symbol)[source]

Gets a delayed price quote for :param:`symbol` from Yahoo! finance.

:param:`symbol` the ticker symbol of the instrument we want to price :type:`symbol` str :returns: MarketData object with labeled price data :rtype:`pd.Series` :raises:`IOError` :raises:`DataError` :raises:`ValueError` :raises:`AttributeError`

Module contents