blob: 387800bb2665ac2bd48d4893ba2b8d0d2c2489a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
# finbudg
Quick cli tool to calculate your expenses and balance for a set period of time.
## TO-DO
* Make error messages more useful
* Show what is being spent most money on
* (Maybe) a way to interactively edit an input file
## How to install
You need to install the Rust toolchain (rustup, cargo, etc) to build this
program. You will also need scdoc to generate the manual pages, and make if you
want to automatically build and install the program.
You can build it yourself using cargo:
```
cargo build --release
```
Or build it and install it using make:
```
make
sudo make install
```
You can remove it by executing:
```
sudo make uninstall
```
For more information about the usage of this program, see `man 1 finbudg` and
`man 5 finbudg` after building and installing with make.
## Example
```
finbudg input.toml
```
### Input:
```toml
start_date = 2020-10-01
end_date = 2020-10-31
budget = 420.0
essential_categories = [
"products",
"transport",
"utilities",
]
[[days]]
date = 2020-10-01
[[days.expenses]]
name = "Potato masher"
price = 3.81
category = "supplies"
[[days.expenses]]
name = "Bacon"
price = 3.33
category = "products"
shared = 2
[[days.expenses]]
name = "Yoghurt"
price = 1.24
category = "products"
qty = 2
[[days.expenses]]
name = "Onion"
price = 0.15
category = "products"
[[days.expenses]]
name = "Chicken"
price = 2.28
category = "products"
shared = 2
[[days]]
date = 2020-10-02
[[days.expenses]]
name = "VPS"
price = 5.0
category = "utilities"
recurring = true
[[days.expenses]]
name = "Transport card"
price = 6.9
category = "transport"
```
### Output:
```
Your expenses for the period of 2020-10-01 - 2020-10-31
Last day on entry: 2020-10-02
Days until period end: 29
Budget: 420.00
Average per day in utilities: 2.50
Average per day in supplies: 1.91
Average per day in transport: 3.45
Average per day in products: 3.50
Average per day in essential expenses: 9.45
Average per day: 11.36
Total in products: 7.00
Total in transport: 6.90
Total in supplies: 3.81
Total in utilities: 5.00
Total in essential expenses: 18.90
Total: 22.71
Left on balance: 397.29
Days until balance runs out:
...taking into account all expenses: 34.99
...taking into account only essential expenses: 42.04
Your expenses are healthy, they should last you from your last day on entry
through your last day of the period.
```
|