Skip to content

Commit

Permalink
feat: add isin to the Asset properties
Browse files Browse the repository at this point in the history
  • Loading branch information
chilango74 committed Dec 31, 2021
1 parent 9fef9d2 commit f32041a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions okama/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __repr__(self):
"exchange": self.exchange,
"currency": self.currency,
"type": self.type,
"isin": self.isin,
"first date": self.first_date.strftime("%Y-%m"),
"last date": self.last_date.strftime("%Y-%m"),
"period length": "{:.2f}".format(self.period_length),
Expand All @@ -66,6 +67,7 @@ def _get_symbol_data(self, symbol) -> None:
self.exchange: str = x["exchange"]
self.currency: str = x["currency"]
self.type: str = x["type"]
self.isin: str = x["isin"]
self.inflation: str = f"{self.currency}.INFL"

@property
Expand Down
1 change: 1 addition & 0 deletions tests/test_asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def test_get_symbol_data(init_asset_spy):
assert init_asset_spy.type == "ETF"
assert init_asset_spy.inflation == "USD.INFL"
assert init_asset_spy.first_date == pd.to_datetime("1993-02")
assert init_asset_spy.isin == "US78462F1030"


def test_close_daily(init_asset_spy):
Expand Down

0 comments on commit f32041a

Please sign in to comment.