Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add statistics #33

Closed
IJustDev opened this issue Oct 13, 2019 · 8 comments
Closed

Add statistics #33

IJustDev opened this issue Oct 13, 2019 · 8 comments

Comments

@IJustDev
Copy link

IJustDev commented Oct 13, 2019

It's a nice feature that each position can have a category. But what if we a add a statistics system in order to have a better overview of the certain categories.

For example:

id name value category
1 Supermarket 20,00€ food
2 Supermarket 13,30€ food

And if we now use a statistics-print command this should print out how much money we pay on average for food and the total of food.

Because I'm using my own periods like october2019 I would also suggest adding a flag (taking an array as input) that keeps track of which periods should be calculated.

$ financeager statistics -p ['october2019', 'november2019']
TOTAL

Food  33,30€

AVERAGE:

Food: 16.65€
@pylipp
Copy link
Owner

pylipp commented Oct 14, 2019

Hej, thank you very much for the input :) statistical insights is definitely a thing that I'd love to have added.
Now there's multiple things in your request (at least from what I understand):

  • first of all, I find it exciting to see that you started using period names different from year numbers. I keep my periods per-year, and for monthly information using print I use a filter, e.g.
$ financeager print --filters date=10-

which return only the entries that have 10- (i.e. october) in their date field (maybe not the most intuitive way; defs room for improvement as well)

  • I find a statistics or even shorter stats command a nice solution. I think we should clarify whether the computation of the statistics should take part on the server- or on the client-side.

@IJustDev
Copy link
Author

Sounds great to me. For the sake of better organization I like to keep each month as a json file. :)

Furthermore I agree. stats is a much cleaner expression.

@pylipp
Copy link
Owner

pylipp commented Oct 14, 2019

I totally agree :) it's great to see different workflows!

Regarding the structure for the stats functionailty: should we

  • have the server return the entire requested periods, and let the client compute the reductions (average etc.), or
  • have the server compute the reductions already, and let the client only do some formatting for displaying (has the advantage of less data load being transferred, especially relevant when using the webservice)?

I forgot to ask, which financeager service do you use? none or flask?

@IJustDev
Copy link
Author

I am using the none version. It depends on what you want to calculate. If we want to display statistics concerning monthly income there is no need for live time updates because all data can be proceed at the end of a month (for example) or after triggering another command (i.e. stats compute). Otherwise if we want to display stats in livetime I would suggest sending the needed information to the client and let him proceed all them informations.

@pylipp
Copy link
Owner

pylipp commented Dec 30, 2019

I'm currently about to split financeager into a core package (the 'none' service version), and enable extending it by plugins (e.g. flask). Hence the considerations about client and server are not that relevant anymore.

Could you describe what kind of statistics you'd like to have calculated?
Or is it sufficient for now to e.g. extend the list (formerly print) command with an option that displays category totals only? E.g.

> financeager list --categories

               Earnings               |                Expenses
Name               Value    Date  ID  | Name               Value    Date  ID
Unspecified          123.45           | Rent                1500.00
=============================================================================
Total                123.45           | Total               1500.00

@IJustDev
Copy link
Author

IJustDev commented Jan 7, 2020

It would be a huge help to see what you spend for what category. The value itself and the percentage related to the whole expenses.

@pylipp
Copy link
Owner

pylipp commented Jan 7, 2020

Alright, thanks for your input! Will come up with a suggestion soon...

In the meantime you can maybe use something like

financeager list -p 2019 -s 2>&1 | grep '^[A-Z]'

to list all category sums of the period 2019 (first earnings, then expenses). For me it was a good overview over the past year.

Edit:
With 0c42e60, the command above becomes

financeager list -p 2019 -s | grep '^[A-Z]'

@pylipp pylipp closed this as completed in ac5874a Jan 21, 2020
@pylipp
Copy link
Owner

pylipp commented Jan 21, 2020

Feel free to experiment with the '--only-categories' option that I just pushed to master :)
EDIT: renamed to '--category-percentage'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants