我所指的薄荷刮刀是mrooney在github上发现的mintapihttps://github.com/mrooney/mintapi
我打电话的时候mint.get_预算()我如何获得具体的花费金额?在
例如,我将如何显示我在“食品和餐饮”上的花费
#get budget data as json
response = json.loads(.....)
# Make the skeleton return structure
budgets = {
'income': response['data']['income'][
str(max(map(int, response['data']['income'].keys())))
]['bu'],
'spend': response['data']['spending'][
str(max(map(int, response['data']['income'].keys())))
]['bu']
}
# Fill in the return structure
for direction in budgets.keys():
for budget in budgets[direction]:
budget['cat'] = categories[budget['cat']]
return budgets
Here是函数。在
以下是如何按类别访问特定支出金额
获取花费金额
要访问类别:
^{pr2}$说明:
.get_budgets()返回包含两个键:值对,收入和支出
关键字“支出:”包含一个字典列表每个字典包含一个支出子类别,例如“食品和餐饮:食品杂货”
相关问题 更多 >
编程相关推荐