hammem / monarchmoney

Python API for Monarch Money
MIT License
124 stars 24 forks source link

Feature: account history #69

Closed pazwicker closed 6 months ago

pazwicker commented 6 months ago

Added support for pulling historical account balances.

The new method pulls account details and extracts the snapshots node. It also loops through each entry in the node and adds accountId and accountName for extra descriptors.

Users may choose to loop through all of their accounts (this is what I plan to do). It might make sense in the future to update this method or add a new method to do the all-account loop automatically, rather than each user creating their own loop through which to gather historical balance data for all of their accounts.

Example of data returned:

[{'date': '2024-01-09',
  'signedBalance': 2.33,
  '__typename': 'AccountSnapshot',
  'accountId': 'xxxACCOUNT_IDxxx',
  'accountName': 'xxxACCOUNT_NAMExxx'},
 {'date': '2024-01-10',
  'signedBalance': 2.33,
  '__typename': 'AccountSnapshot',
  'accountId': 'xxxACCOUNT_IDxxx',
  'accountName': 'xxxACCOUNT_NAMExxx'}]
pazwicker commented 6 months ago

Hey @hammem, hate to bug, but possible to get a review on this? Thanks!