Skip to content

Commit

Permalink
Merge pull request #1 from mbk-dev/master
Browse files Browse the repository at this point in the history
Few minor changes
  • Loading branch information
fzhulitov authored Oct 17, 2022
2 parents 983ea42 + bc23433 commit 2bb7864
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
poetry.lock
9 changes: 6 additions & 3 deletions boi/kr.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import pandas as pd
import boi
def get_ir() -> pd.Series:
df = boi.request_data.get_data_frame()
return df


def get_ir(datestart: str = "27/01/1994", dateend: str = '13/10/2022') -> pd.Series:
s = boi.request_data.get_data_frame(seriescode='RIB_BOI.D', datestart=datestart, dateend=dateend)
s.rename("key_rate", inplace=True)
return s / 100

5 changes: 3 additions & 2 deletions boi/request_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def get_data_frame(seriescode: str = 'RIB_BOI.D',
resp = abc.text
ldf = pd.read_html(StringIO(resp), parse_dates=[0])
df = ldf[1]
df.set_index(0, inplace=True)
df.rename(columns={df.columns[0]: "date"}, inplace=True)
df.set_index("date", inplace=True)
df.index = df.index.to_period(freq='D')
return df
return df.squeeze()

0 comments on commit 2bb7864

Please sign in to comment.