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