siddhantac / puffin

A beautiful terminal dashboard for hledger 💰
MIT License
273 stars 6 forks source link

Include a basic report generation system #9

Closed Enqueued closed 9 months ago

Enqueued commented 1 year ago

I would like to have access within puffin to be able to generate basic reports of my finances:

This should be fairly easy given hledger already provides commands for these reports

I can see an issue with P&Ls and Equity changes as they would require specified arguments which would create a need for some error handling of argument inputs and the like. The above 3 commands should be fairly simple to incorporate. Example: Tab shown above states 'Balance Sheet' -> user moves to tab -> display loading animation -> generate basic balance sheet with given hledger command -> saved as a temp file upon generation -> once file exists pipe file output to pane under tab -> remove temp file when puffin is closed or upon generation with a different flag using a keybind (can be implemented later)

siddhantac commented 1 year ago

Hello,

Income statement is already integrated. Please take a look at the gifs in the Readme for a sample.

I'll look into balance sheet and cashflow next. I haven't had time to work on this project lately. Hopefully I can pick it up again soon.

Thanks for your interest! ❤️

siddhantac commented 1 year ago

Since you are interested in the reports, I'd like to ask your opinion on how the data is presented.

Currently, hledger is outputting the data in CSV format and puffin is parsing that to show it in a table. But hledger's own reports look pretty good too, especially with the --pretty flag enabled.

Would you prefer to see the data in a table (with highlightable rows) or just a dump of the output of hledger incomestatement --pretty in a pager?

Enqueued commented 1 year ago

I would probably like just a dump of the output and pipe it into gloss or something via charm to spice it up. I dont think having a row selection would help out and it would just lead to more questions: "If I can highlight my groceries, why cant I just click it and get a breakdown of expenditures through it?" etc.

Having a pure dump would be good enough for me~

If you're open to it I would like to help with the project if I can; I know that some of these projects are the devs babies so its hard to break into it so I just thought I would ask first.

siddhantac commented 1 year ago

Yeah I have been playing with the idea of just dumping the output in bubbletea's pager. One possible issue is that it might lose the colored output that hledger provides.

I'd welcome help! I haven't had time to work on this recently. If you can help in making some progress, that would be great!

siddhantac commented 1 year ago

I have started working on using pagers instead of tables.

I like this approach for multiple reasons:

  1. Less maintenance
    1. CSV kept breaking
    2. it is harder to debug with the many columns which vary between reports
    3. no need to keep up to date with changes in hledger as this will always work no matter how hledger outputs the data
  2. Closer to hledger - the output looks like it does in hledger

I might still keep the option of using CSV + tables but I'll be focusing on this approach for now.