Type adjustments
This commit is contained in:
parent
bcae3d4e29
commit
de619e2548
|
@ -18,18 +18,19 @@ import fin_defs
|
|||
import requests
|
||||
from frozendict import frozendict
|
||||
from nordnet_api_client import NordnetClient
|
||||
from nordnet_api_client.data import Instrument
|
||||
|
||||
from .data import Depo, DepoFetcher, DepoGroup, DepoSingle
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def asset_from_instrument(intrument) -> fin_defs.Asset | None:
|
||||
if intrument.instrument_group_type == 'FND':
|
||||
def asset_from_instrument(instrument: Instrument) -> fin_defs.Asset | None:
|
||||
if instrument.instrument_group_type == 'FND':
|
||||
return None
|
||||
symbol = intrument.symbol
|
||||
exchange_id = intrument.tradables[0].mic
|
||||
return fin_defs.Stock(symbol, fin_defs.EXCHANGES_BY_IDS[exchange_id])
|
||||
symbol = instrument.symbol
|
||||
exchange_id = instrument.tradables[0].mic
|
||||
return fin_defs.Stock(symbol, fin_defs.EXCHANGES_BY_IDS[exchange_id], nordnet_id = instrument.instrument_id)
|
||||
|
||||
|
||||
EMPTY_DICT: Mapping[str, str | int] = frozendict()
|
||||
|
|
Loading…
Reference in New Issue
Block a user