.. _f-astock: module ``finance.astock`` ========================= .. inheritance-diagram:: pyensae.finance.astock Short summary +++++++++++++ module ``pyensae.finance.astock`` Downloads stock prices (from Yahoo website) and other prices. :githublink:`%|py|5` Classes +++++++ +-------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | class | truncated documentation | +=====================================================================================+====================================================================================================================+ | :class:`StockPrices ` | Defines a class containing stock prices, provides basic functions, the class uses :epkg:`pandas` to load the data. | +-------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :class:`StockPricesException ` | Raised by StockPrices classes. | +-------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ | :class:`StockPricesHTTPException ` | Raised by StockPrices classes. | +-------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ Properties ++++++++++ +------------------------------------------------------------------+-------------------------+ | property | truncated documentation | +==================================================================+=========================+ | :meth:`dataframe ` | Returns the dataframe. | +------------------------------------------------------------------+-------------------------+ | :meth:`shape ` | | +------------------------------------------------------------------+-------------------------+ | :meth:`tick ` | Returns the tick name. | +------------------------------------------------------------------+-------------------------+ Static Methods ++++++++++++++ +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | staticmethod | truncated documentation | +==============================================================================+===================================================================================================================================================+ | :meth:`available_dates ` | Returns the list of values (Open or High or Low or Close or Volume) from each stock for all the available_dates ... | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`covariance ` | Computes the covariances matrix (of returns). | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`draw ` | Draws a graph showing one or several time series. The example was taken `date_demo.py `_. ... | +------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ Methods +++++++ +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | method | truncated documentation | +=========================================================================+=============================================================================================================================================+ | :py:meth:`__getitem__ ` | Overloads the ``getitem`` operator to get a :class:`StockPrice` object. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__init__ ` | | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :py:meth:`__len__ ` | | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`df ` | Returns the dataframe. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`FirstDate ` | Returns the first date. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`head ` | usual | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`keep_dates ` | removes undesired dates | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`LastDate ` | Returns the first date. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`missing ` | Returnq the list of missing dates from an overset of trading dates. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`plot ` | See :meth:`draw `. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`returns ` | Builds the series of returns. | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`tail ` | usual | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`to_csv ` | Saves the file in text format, see `to_csv `_ ... | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ | :meth:`to_excel ` | Saves the file in Excel format, see `to_excel `_ ... | +-------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ Documentation +++++++++++++ .. automodule:: pyensae.finance.astock :members: :special-members: __init__ :show-inheritance: