示例#1
0
文件: bank.py 项目: bee-san/bank
 def __init__(self):
     client = Monzo(
         'access_token_goes_here'
     )  # Replace access token with a valid token found at: https://developers.getmondo.co.uk/
     account_id = client.get_first_account()[
         'id']  # Get the ID of the first account linked to the access token
     balance = client.get_balance(account_id)  # Get your balance object
     self.spend_today = balance['spend_today']
     self.balance = balance['balance']
示例#2
0
from monzo.monzo import Monzo  # Import Monzo class
from pprint import pprint
import json
import hashlib
import numpy as np

client = Monzo(
    'eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJlYiI6InpZS2pBb3lWV0RjNmNkMkd0TkFmIiwianRpIjoiYWNjdG9rXzAwMDA5ZDZtMDZNVnZyZW91bkVnSFIiLCJ0eXAiOiJhdCIsInYiOiI1In0.SllGxvyF4RO4f093tPg3mgIZCc-Z-tsIxKG7dkX8HspMyKDGF5FQIc-fRf9CHzcE3GQOvI9oqos_jE1xKJBfYw'
)  # Replace access token with a valid token found at: https://developers.monzo.com/
# account_id = client.get_first_account()['id'] # Get the ID of the first account linked to the access token
account_id = "acc_00009VIJcdBdP5vmFVETYn"
balance = client.get_balance(account_id)  # Get your balance object
#print("My balance is ", balance['balance']) # 100000000000
#print(balance['currency']) # GBP
#print(balance['spend_today']) # 2000

transactions = client.get_transactions(account_id)
# loaded_json = json.loads(transactions)
#for x in transactions:
#print("{}: {}".format(x, transactions[x]))

# pprint(transactions['transactions'][-1])
trans = transactions['transactions']
import numpy as np


def weightingFunction(number):
    return abs(number)  #* 250


def main():