#NEWLINE# def get_accounts( self , get_detail = False ) : #NEWLINE# #INDENT# req_id = str ( self . request_id ) #NEWLINE# input = { #NEWLINE# #INDENT# 'args' : { #NEWLINE# #INDENT# 'types' : [ 'BANK' , 'CREDIT' , 'INVESTMENT' , 'LOAN' , 'MORTGAGE' , 'OTHER_PROPERTY' , 'REAL_ESTATE' , 'VEHICLE' , 'UNCLASSIFIED' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# 'id' : req_id , #NEWLINE# 'service' : 'MintAccountService' , #NEWLINE# 'task' : 'getAccountsSorted' , #NEWLINE# #UNINDENT# } #NEWLINE# data = { #NEWLINE# #INDENT# 'input' : json . dumps ( [ input ] ) , #NEWLINE# #UNINDENT# } #NEWLINE# account_data_url = ( 'https://wwws.mint.com/bundledServiceController.xevent?legacy=false&token=' + self . token ) #NEWLINE# response = self . post ( account_data_url , data = data , headers = self . json_headers ) . text #NEWLINE# self . request_id = ( self . request_id + 1 ) #NEWLINE# if ( req_id not in response ) : #NEWLINE# #INDENT# raise Exception ( ( 'Could not parse account data: ' + response ) ) #NEWLINE# #UNINDENT# response = json . loads ( response ) #NEWLINE# accounts = response [ 'response' ] [ req_id ] [ 'response' ] #NEWLINE# for account in accounts : #NEWLINE# #INDENT# for df in DATE_FIELDS : #NEWLINE# #INDENT# if ( df in account ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ts = ( self [ df ] / 1000.0 ) #NEWLINE# #UNINDENT# except TypeError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# account [ ( df + 'InDate' ) ] = datetime . fromtimestamp ( ts ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if get_detail : #NEWLINE# #INDENT# accounts = self . populate_extended_account_detail ( accounts ) #NEWLINE# #UNINDENT# return accounts