コード例 #1
0
 def __set_account_info(self):
     account_urls = Account.all_urls(self)
     if len(account_urls) > 1:
         raise NotImplementedError("fast_arrow 'currently' does not handle multiple account authentication.")
     elif len(account_urls) == 0:
         raise AuthenticationError("fast_arrow expected at least 1 account.")
     else:
         self.account_url = account_urls[0]
         self.account_id = get_last_path(self.account_url)
         self.authenticated = True
コード例 #2
0
ファイル: option_event.py プロジェクト: yumikohey/fast_arrow
 def mergein_instrumentdata_list(cls, client, option_events):
     results = []
     ids = [util.get_last_path(oe['option']) for oe in option_events]
     idatas = Option.fetch_by_ids(client, ids)
     for oe in option_events:
         idata = [x for x in idatas if x['url'] == oe['option']][0]
         merge_me = {
             "option_type": idata["type"],
             "symbol": idata["chain_symbol"]
         }
         merged_dict = dict(list(oe.items()) + list(merge_me.items()))
         results.append(merged_dict)
     return results
コード例 #3
0
 def _extract_ids(cls, option_positions):
     ids = []
     for op in option_positions:
         _id = util.get_last_path(op["option"])
         ids.append(_id)
     return ids