Skip to main content

Retrieves and analyzes financial data of multiple companies.

Project description

This package can scrape financial data from Yahoo Finance for multiple companies. 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.

Files for FundamentalAnalysis, version 0.1.5
Filename, size File type Python version Upload date Hashes
Filename, size FundamentalAnalysis-0.1.5-py3-none-any.whl (20.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size FundamentalAnalysis-0.1.5.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page