Skip to main content

Allows for retrieving and analysing financial data of multiple companies at once.

Project description

This package can scrape financial data from Yahoo Finance for multiple companies at once. This includes the ratios, balance sheets, income statements, cashflows and stock data. Furthermore, the analysis functions are able identify the state of the companies over the last years and how they are performing against each other.

Functions

A short description of the available functions within the package. Please see the docstrings for further explanation.

  • summary()
    • Scapes data from the 'homepage' of a ticker (example), alters text (%, k, M, B) to ensure everything is seen as a float or integer and puts everything in a DataFrame for comparison.
  • balance_sheet()
    • Scrapes data from the Financials > Balance Sheet page and orders it in a DataFrame.
  • income_statement()
    • Scrapes data from the Financials > Income Statement page and orders it in a DataFrame.
  • cashflows()
    • Scrapes data from the Financials > Cash Flows page and orders it in a DataFrame.
  • ratios()
    • Scrapes data from the Statistics page, alters text (%, k, M, B) to ensure everything is seen as a float or integer and puts everything in a DataFrame for comparison.
  • balance_sheet_analysis()
    • Uses data from balance_sheet() to create several graphs that show the trend over time.
  • income_statement_analysis()
    • Uses data from income_statement() to create several graphs that show the trend over time.
  • cashflow_analysis()
    • Uses data from cashflows() to create several graphs that show the trend over time.
  • ratio_analysis()
    • Uses data from ratios() to create several graphs that show the ratios right now.
  • stock_data()
    • Retrieves stock data based on the pandas_datareader library. Extras include the recognition of private companies to prevent a sudden stop as well as the calculation of returns.
  • correlation_matrix()
    • A matrix that uses input from stock_data() to calculate correlations between the symbols as well as visually show this in a graph when graph=True.
  • rss_feed()
    • News obtained from Yahoo Finance RSS for each chosen ticker. Can potentially be useful to read more about a company without leaving Python.

Addition: leaving the ticker field blank will cause the functions to download the most trending tickers according to Yahoo Finance.

Installation

  1. pip install FundamentalAnalysis
  2. (within Python) import FundamentalAnalysis as fa

Example usage

Collect data from Yahoo Finance including balance sheets, income statements, cashflows, ratios and stock data of all selected tickers.

import FundamentalAnalysis as fa

symbol = ['TSLA','AAPL','MSFT']

balance_sheet = fa.balance_sheet(symbol)
income_statement = fa.income_statement(symbol)
cashflows = fa.cashflows(symbol)
ratios = fa.ratios(symbol)
stock_data = fa.stock_data(2015, 2019, symbol, include_returns=True)

Afterwards you can compare the numbers between companies or plot them to see posible growth/decline. Next to that, by using one of the analysis functions, you can quickly see most of the important metrics. (i.e. ratio_analysis(ratios, symbol))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

FundamentalAnalysis-0.1.0.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

FundamentalAnalysis-0.1.0-py3-none-any.whl (19.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page