shutupflanders / moneydashboard

Python library for MoneyDashboard
MIT License
12 stars 4 forks source link

Include transaction/budget data #3

Open m-roberts opened 4 years ago

m-roberts commented 4 years ago

Is there a way to get transaction/budget data? Anything to show balance trends, spend by category, budget progress, etc...

It's great to be able to retrieve the current balance in each account, but advanced views require more detail.

shutupflanders commented 4 years ago

There are plenty of ways to get this, I may end up forking the project for this though as the original idea for this was just to bring basic balance info into HomeAssistant as a sensor.

shutupflanders commented 4 years ago

I suppose it's easier to ask what you want from this project? and what are you using it in?

m-roberts commented 4 years ago

I am interested in developing a MagicMirror module for this. It'd be great to track trend data, produce a burndown chart for spending per area, produce warnings for problematic/untagged spending, etc.

Perhaps you could explain how you've been able to determine the endpoints for the API, so that I can continue to work on this?

shutupflanders commented 4 years ago

To get the API endpoints I simply just sifted through the network tab in the Chrome developer tools, alongside using Postman to save the requests.

I'm probably not going to implement more than we have now to be honest, it was a quick project to get the net worth into HomeAssistant and that's done, I don't really have the time to add all this stuff to it. Feel free to continue building it in your fork though.

shutupflanders commented 3 years ago

@m-roberts managed to pick a bit of this up today, added the ability to pull the data from the transactions widget on the dashboard, check the v1.0.11 branch (get_transactions()) if you feel like adding anything.

If you want something to graph, there seems to be historical balance data returned from https://my.moneydashboard.com/api/CashflowEvents?fromDate=2021-09-17&toDate=2021-12-16 - might be something to look into.

Likely I won't get chance to work on this for a few more weeks but I'll get on it when I can.

markferry commented 3 years ago

@shutupflanders did you notice the https://my.moneydashboard.com/transaction/GetTransactions?limitTo=999 API that Terence Eden found a while back?

Tested it moments ago and it gives transactions of the form:

  {
    "Id": 754837316,
    "Description": "THE DUKE OF WELLINGTON",
    "OriginalDescription": "THE DUKE OF WELLINGTON",
    "Amount": -6.3,
    "Date": "/Date(1631059200000)/",
    "OriginalDate": "/Date(-62135596800000)/",
    "IsDebit": true,
    "TagId": -1,
    "MerchantId": 194632,
    "AccountId": 1666071,
    "Notes": null,
    "NativeCurrency": "GBP",
    "NativeAmount": -6.3,
    "CurrencyExchange": null,
    "AvailableCurrencyExchanges": []
  },

(Using this to write an importer for beancounttools)

shutupflanders commented 3 years ago

@markferry cheer for that, I've known about a lot of the endpoints for a while, the original need for this project was to just get the net balance into HomeAssistant so I haven't spent the time adding everything else in just yet.