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.
- Uses data from
income_statement_analysis()
- Uses data from
income_statement()
to create several graphs that show the trend over time.
- Uses data from
cashflow_analysis()
- Uses data from
cashflows()
to create several graphs that show the trend over time.
- Uses data from
ratio_analysis()
- Uses data from
ratios()
to create several graphs that show the ratios right now.
- Uses data from
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.
- Retrieves stock data based on the
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 whengraph=True
.
- A matrix that uses input from
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
pip install FundamentalAnalysis
- (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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for FundamentalAnalysis-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b82fd72c252f9b63e0f38b85f5264a25e0fc09faffc86f32d5089c0d1bb58e1a |
|
MD5 | d2ff8861ee7edae12815fdd56248d716 |
|
BLAKE2b-256 | c0ac96af529d1ab8fb67d84c0a9059609090984607cf36f4b8f2b3bea3a61802 |
Hashes for FundamentalAnalysis-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa79c272df1a983c7c642a135ccf8c96ff53c8bc375538ebc1168f9b0636d517 |
|
MD5 | 89545b042719e7d23427f84e1900ed15 |
|
BLAKE2b-256 | bd8b6a3248d2f904a4a5d33815f7c7ae14e87b4a032401df7aeef95d7c128415 |