Skip to content

Commit 12b9f29

Browse files
committed
Merge branch 'develop'
2 parents 1807c1f + b026b4a commit 12b9f29

File tree

84 files changed

+4974
-7500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+4974
-7500
lines changed

README.md

Lines changed: 12 additions & 387 deletions
Large diffs are not rendered by default.

examples/Finance Toolkit - 9. Economics Module.ipynb

Lines changed: 738 additions & 1331 deletions
Large diffs are not rendered by default.

financetoolkit/economics/economics_controller.py

Lines changed: 51 additions & 1018 deletions
Large diffs are not rendered by default.

financetoolkit/economics/oecd_model.py

Lines changed: 98 additions & 683 deletions
Large diffs are not rendered by default.

financetoolkit/fixedincome/fixedincome_controller.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ def get_government_bond_yield(
770770
self,
771771
short_term: bool = False,
772772
period: str | None = None,
773-
forecast: bool = False,
774773
growth: bool = False,
775774
lag: int = 1,
776775
rounding: int | None = None,
@@ -804,7 +803,6 @@ def get_government_bond_yield(
804803
short_term (bool, optional): Whether to return the short-term interest rate. Defaults to False.
805804
This means that the long-term interest rate will be returned.
806805
period (str | None, optional): Whether to return the monthly, quarterly or the annual data.
807-
forecast (bool, optional): Whether to return the forecasted data. Defaults to False.
808806
growth (bool, optional): Whether to return the growth data or the actual data.
809807
lag (int, optional): The number of periods to lag the data by.
810808
rounding (int | None, optional): The number of decimals to round the results to. Defaults to None.
@@ -846,18 +844,15 @@ def get_government_bond_yield(
846844

847845
if short_term:
848846
government_bond_yield = oecd_model.get_short_term_interest_rate(
849-
period=period, forecast=forecast
847+
period=period,
850848
)
851849
else:
852850
government_bond_yield = oecd_model.get_long_term_interest_rate(
853-
period=period, forecast=forecast
851+
period=period,
854852
)
855853

856854
if government_bond_yield.empty:
857-
raise ValueError(
858-
"No data available for the selected period "
859-
f"{'and forecast' if forecast else ''}."
860-
)
855+
raise ValueError("No data available for the selected period ")
861856

862857
if growth:
863858
government_bond_yield = calculate_growth(
@@ -868,7 +863,7 @@ def get_government_bond_yield(
868863
)
869864

870865
government_bond_yield = government_bond_yield.loc[
871-
self._start_date : None if forecast else self._end_date
866+
self._start_date : self._end_date
872867
]
873868

874869
return government_bond_yield.round(rounding if rounding else self._rounding)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "financetoolkit"
3-
version = "1.9.5"
3+
version = "1.9.6"
44
description = "Transparent and Efficient Financial Analysis"
55
license = "MIT"
66
authors = ["Jeroen Bouma"]
Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
,Open,Open,Open,High,High,High,Low,Low,Low,Close,Close,Close,Adj Close,Adj Close,Adj Close,Volume,Volume,Volume,Dividends,Dividends,Dividends,Return,Return,Return,Volatility,Volatility,Volatility,Excess Return,Excess Return,Excess Return,Excess Volatility,Excess Volatility,Excess Volatility,Cumulative Return,Cumulative Return,Cumulative Return
22
,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark,AAPL,MSFT,Benchmark
33
Date,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
4-
2010,12.0,28.0,126.0,12.0,28.0,126.0,11.0,28.0,125.0,12.0,28.0,126.0,10.0,22.0,98.0,193508000,24752000,91218900,0.0,1.0,2.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0
5-
2011,14.0,26.0,126.0,15.0,26.0,126.0,14.0,26.0,126.0,14.0,26.0,126.0,12.0,21.0,100.0,179662000,27395700,95599000,0.0,1.0,3.0,0.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0
6-
2012,18.0,27.0,140.0,19.0,27.0,143.0,18.0,26.0,140.0,19.0,27.0,142.0,16.0,22.0,116.0,659492400,42749500,243935200,0.0,1.0,3.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,1.0,1.0
7-
2013,20.0,37.0,184.0,20.0,38.0,185.0,20.0,37.0,184.0,20.0,37.0,185.0,18.0,31.0,153.0,223084400,17503500,86119900,0.0,1.0,3.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,2.0,1.0,2.0
8-
2014,28.0,47.0,208.0,28.0,47.0,208.0,28.0,46.0,205.0,28.0,46.0,206.0,25.0,40.0,174.0,165613600,21552500,130333800,0.0,1.0,4.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,2.0,2.0
9-
2015,27.0,56.0,205.0,27.0,56.0,206.0,26.0,55.0,204.0,26.0,55.0,204.0,24.0,49.0,176.0,163649200,27334100,114877900,1.0,1.0,4.0,-0.0,0.0,0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,2.0,2.0,2.0
10-
2016,29.0,63.0,225.0,29.0,63.0,225.0,29.0,62.0,223.0,29.0,62.0,224.0,27.0,57.0,197.0,122345200,25579900,108998300,1.0,1.0,5.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,3.0,3.0,2.0
11-
2017,43.0,86.0,269.0,43.0,86.0,269.0,42.0,86.0,267.0,42.0,86.0,267.0,40.0,80.0,240.0,103999600,18717400,96007400,1.0,2.0,5.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,4.0,4.0,2.0
12-
2018,40.0,101.0,250.0,40.0,102.0,250.0,39.0,100.0,247.0,39.0,102.0,250.0,38.0,96.0,229.0,140014000,33173800,144299400,1.0,2.0,5.0,-0.0,0.0,-0.0,0.0,0.0,0.0,-0.0,0.0,-0.0,0.0,0.0,0.0,4.0,4.0,2.0
13-
2019,72.0,157.0,321.0,73.0,158.0,322.0,72.0,156.0,320.0,73.0,158.0,322.0,71.0,151.0,300.0,100805600,18369400,57077300,1.0,2.0,6.0,1.0,1.0,0.0,0.0,0.0,0.0,1.0,1.0,0.0,0.0,0.0,0.0,7.0,7.0,3.0
14-
2020,136.0,225.0,372.0,136.0,226.0,373.0,133.0,221.0,372.0,134.0,222.0,372.0,131.0,215.0,354.0,96452100,20272300,49455300,1.0,2.0,6.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,13.0,10.0,4.0
4+
2020,134.0,222.0,372.0,135.0,223.0,375.0,132.0,220.0,371.0,133.0,222.0,374.0,131.0,217.0,359.0,99089086,20942100,78520700,3.0,2.0,6.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,1.0,1.0,1.0
5+
2021,178.0,339.0,476.0,179.0,339.0,477.0,177.0,336.0,475.0,178.0,336.0,475.0,176.0,331.0,462.0,64062261,18000800,65237400,1.0,2.0,6.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,0.0,1.0,2.0,1.0
6+
2022,128.0,238.0,381.0,130.0,240.0,383.0,127.0,237.0,378.0,130.0,240.0,382.0,129.0,238.0,378.0,76204209,21938500,84022200,1.0,3.0,6.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,-0.0,-0.0,-0.0,0.0,0.0,0.0,1.0,1.0,1.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
,AAPL,MSFT
2-
2020,8318.9299,57852.0784
3-
2021,160.2573,306.022
4-
2022,155.4936,279.3459
2+
2020,-3144.788,-4585.8799
3+
2021,160.457,306.2057
4+
2022,156.7935,281.276

0 commit comments

Comments
 (0)