Financetoolkit

Latest version: v1.9.9

Safety actively analyzes 688674 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 6 of 13

1.3.1

This is a massive release to the FinanceToolkit adding **a lot** more functionality including 30+ technical indicators. These are the key improvements:

**Added a `technicals` class**, this has the option to calculate over 30 technical indicators (e.g. Relative Strength Index and Bollinger Bands) with the chosen dataset. Just like other components of the FinanceToolkit, this works very well with any list of tickers. As an example, the following collects all technical indicators:

python
from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT", "AMZN"])

toolkit.technicals.collect_all_indicators()


This returns the following:

<img width="1473" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/7dbc9b85-c697-44eb-b2dc-f7ebacfdf697">

Just like with ratios, it is also possible to show single indicators:

python
from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT", "AMZN"])

toolkit.technicals.get_bollinger_bands()


<img width="1207" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/9e271e4a-1f13-48b5-8299-a75c30fc2960">

This is a major addition as it is now possible to do quantitative research both based on fundamental data and technical indicators further accelerating the package to also become a great place for Machine Learning professionals.

**I've expanded the historical dataset with new vital columns**. It not only returns Open, High, Low, Close and Returns but also shows Dividends, Volatility, Excess Returns (minus Risk Free Rate), Excess Volatility and Cumulative Returns.

python
from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT", "AMZN"])

toolkit.get_historical_data()


<img width="1210" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/17e14d00-ffdf-4195-8925-f3535fbc2187">

**I've reworked a lot of docstrings.** This makes it possible to better understand what a function is providing and what the meaning is of the result. This is also further highlighted on the documentation page [here](https://www.jeroenbouma.com//projects/financetoolkit/docs). As an example:


"""
Calculate the debt to equity ratio, a solvency ratio that measures the
proportion of a company's equity that is financed by debt.

The debt to equity ratio, also known as the D/E ratio, indicates the relative
contribution of debt and equity to a company's capital structure. It helps assess
the level of financial risk a company carries due to its debt obligations. A higher
ratio implies a higher reliance on debt to finance the business, which could increase
risk but also potentially lead to higher returns for shareholders.

Args:
rounding (int, optional): The number of decimals to round the results to. Defaults to 4.
growth (bool, optional): Whether to calculate the growth of the ratios. Defaults to False.
lag (int | str, optional): The lag to use for the growth calculation. Defaults to 1.

Returns:
pd.DataFrame: Debt to equity ratio values.

Notes:
- The method retrieves historical data and calculates the ratio for each asset in the Toolkit instance.
- If `growth` is set to True, the method calculates the growth of the ratio values using the specified `lag`.

As an example:

from financetoolkit import Toolkit

toolkit = Toolkit(["AAPL", "TSLA"], api_key=FMP_KEY)

debt_to_equity_ratios = toolkit.ratios.get_debt_to_equity_ratio()
"""


I've added in a **risk free rate**. This is based on ^TNX which is the 10-year Treasury Rate. This is relevant for calculations that require a Risk Free Rate such as the Sharpe Ratio. This is hidden in the back-end but can be retrieved (after using `get_historical_data`) with `companies._daily_risk_free_rate`. As an example:

python
from financetoolkit import Toolkit

toolkit = Toolkit(tickers=["AAPL", "MSFT", "AMZN"])

toolkit.get_historical_data()

toolkit._daily_risk_free_rate


Which returns:

<img width="578" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/7b0351f0-3082-41d3-b7d3-5260710611f2">

1.2.6

Major release with numerous new functionality and a lot of misc fixes. The major components are:

**Calculating custom ratios are greatly improved with a lot of robustness.** This now features the following things:

- **Simple operations such as:** `'Quick Assets': 'Cash and Short Term Investments + Accounts Receivable'`
- **Working with multiple operations:** `'Cash Op Expenses':'Cost of Goods Sold + Selling, General and Administrative Expenses - Depreciation and Amortization'`,
- **Using curly brackets:** `'WC / Net Income as %': '(Working Capital / Net Income) * 100'`,
- **Defining a criteria:** `'Large Revenues': 'Revenue > 1000000000'`,
- **Using actual numbers:** `'Daily Cash Op Expenses': 'Cash Op Expenses / 365'`,
- **Combining earlier defined formulas:** `'Defensive Interval':'Quick Assets / Daily Cash Op Expenses'`

As an example (also see the README and Notebooks):

<img width="1467" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/7ebdab9d-c629-4bd2-a841-9a4eebb46657">

**The historical dataset now calculates OLHC, volumes, returns, cumulative returns and volatility**. This also works for different periods (e.g. yearly) to see how volatility moved over the years for example. Next to that, within the backend a bit more data is collected than displayed to overcome issues with incomplete quarters or years.

<img width="1453" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/097b43d3-2e8d-462a-8c49-74ad4a4a55b1">

It is possible to view **treasury rates** over the last 3 months for multiple maturities. This makes it possible to create yield curves for multiple months and can serve as a basis for discounting.

<img width="746" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/1c849ee3-2a73-4524-8eca-52568c398cc6">

**Improved the External Datasets usage.** Previously, this was a little bit buggy and could result in a lot of errors when things didn't match up right. This has now been corrected and the example is also better explained. Please see the updated Jupyter Notebook [here](https://www.jeroenbouma.com/projects/financetoolkit/external-datasets).

1.2.5

I've been busy again to improve numerous docstrings, optimize code and ensure that there is better error handling. I've introduced some other features that have been requested which are the following:

An **earnings calendar** in which all exact earnings dates in the past and in the future are displayed including estimates. It has the option to show the quarterly statement dates or the annual dates and can be shown for any amount of companies.

<img width="682" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/45b93382-5f4f-4ad9-9793-541a22352a4e">

The option to **segregate revenue by product**. This makes it possible to understand where the revenue is coming from. Note that this is a Professional and Enterprise Subscription feature. As an example, Apple.

<img width="1210" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/6dcb78b0-bb59-4ed2-b903-57c66de1d37a">

The option to **segregate revenue by geography**. This makes it possible to understand from what countries, a company makes its revenue. Note that this is a Professional and Enterprise Subscription feature. As an example, Google.

<img width="1210" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/47c9b60d-aa4f-46c8-aa20-aa7c76fd3ea1">

As you can see, both options can be either quarterly or annually.

1.2.4

Many many new additions!

- Introduced a TQDM progress bar for financial statements. This **only** activates if you have TQDM installed and can also be disabled by setting `progress_bar=False` in the Toolkit initalization. The purpose of this is to make it more clear how far the data collection is progressing. This fixes 53.
- Added a sleeper in case you breach the request limit. This is mostly relevant for Premium subscriptions that reach the 300 (or 750) API Calls per minute. On average, this should be almost never an issue. This fixes 52.
- I've done some number formatting. Ratios or percentages are depicted with 4 decimals and all other values with 2. This made more sense and keeps the data concise.
- Many QOL updates and Docstring fixes.

I've extended the historical dataset with **dividends, returns and cumulative returns**. As an example:

<img width="1211" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/6a782c3f-a3f4-4729-a191-78350591f129">

I've added in the ability to collect **Analyst Estimates**. This gives insights in how a range of analysts thought about the past and think about the future of each company.

<img width="1213" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/30cd7295-9317-43d0-85c3-00bb4cfc5c4f">

The **Enterprise functionality** is now located in models and is calculated with the available data. This makes it more in line with the rest of the Toolkit. This also shows the new progress bars.

<img width="1120" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/7060421a-bd91-44d8-b10b-501133ffc575">

1.2.2

This release introduces growth metrics. This allows any financial statement, ratio or model to also be viewed as growth metrics. Next to that, with the lag parameter multiple periods can be defined. This is now also updated in the Example files. Lastly, the historical data output now also calculates returns.

For example:

python
from financetoolkit import Toolkit

API_KEY = "FMP_KEY"

companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], api_key=API_KEY, start_date="2000-01-01"
)

companies.get_income_statement(growth=True)


Which returns:

<img width="1100" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/4a832f09-6840-45f6-81f3-b25ce1e8acc8">

And an example for ratios with multiple lags:

python
from financetoolkit import Toolkit

API_KEY = "FMP_KEY"

companies = Toolkit(
["AAPL", "MSFT", "GOOGL", "AMZN"], api_key=API_KEY, start_date="2000-01-01"
)

companies.ratios.collect_all_ratios(growth=True, lag=[1, 2, 3])


Which returns:

<img width="1100" alt="image" src="https://github.com/JerBouma/FinanceToolkit/assets/46355364/18521a4f-d905-4563-b707-326a0d0ee9d6">

1.2.1

I've updated much of the docstrings to now include examples. These examples and the code documentation in general is now depicted on: https://www.jeroenbouma.com/projects/financetoolkit

Furthermore, I've introduced dividends within the Historical data. This allow you to see annual and quarterly dividend values for each.

**It’s good to note the following:** the most recent annual and quarterly numbers might differ from what other websites report because this is based on the dividend that actually has been paid and not what is announced.

These are the annual values:
![image](https://github.com/JerBouma/FinanceToolkit/assets/46355364/db13a0aa-995c-4285-9ff5-8635d7437af2)

And these are the quarterly values:
![image](https://github.com/JerBouma/FinanceToolkit/assets/46355364/d118a260-f97e-41cb-95ad-e09145851119)

Page 6 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.