hledger-forecast 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +0 -2
- data/README.md +150 -71
- data/example.journal +35 -0
- data/example.yml +35 -36
- data/hledger-forecast.gemspec +5 -4
- data/lib/hledger_forecast/cli.rb +35 -93
- data/lib/hledger_forecast/generator.rb +233 -90
- data/lib/hledger_forecast/summarize.rb +4 -5
- data/lib/hledger_forecast/tracker.rb +37 -0
- data/lib/hledger_forecast/version.rb +1 -1
- data/lib/hledger_forecast.rb +1 -1
- data/spec/command_spec.rb +14 -4
- data/spec/custom_spec.rb +35 -42
- data/spec/half-yearly_spec.rb +22 -6
- data/spec/modifier_spec.rb +87 -0
- data/spec/monthly_end_date_spec.rb +47 -0
- data/spec/monthly_end_date_transaction_spec.rb +32 -0
- data/spec/monthly_spec.rb +35 -27
- data/spec/once_spec.rb +22 -7
- data/spec/quarterly_spec.rb +21 -7
- data/spec/stubs/{monthly/forecast_monthly.yml → forecast.yml} +7 -7
- data/spec/stubs/transactions_found.journal +24 -0
- data/spec/stubs/transactions_found_inverse.journal +24 -0
- data/spec/stubs/transactions_not_found.journal +16 -0
- data/spec/track_spec.rb +197 -0
- data/spec/yearly_spec.rb +21 -7
- metadata +32 -74
- data/spec/start_date_spec.rb +0 -12
- data/spec/stubs/custom/forecast_custom_days.yml +0 -14
- data/spec/stubs/custom/forecast_custom_months.yml +0 -14
- data/spec/stubs/custom/forecast_custom_weeks.yml +0 -14
- data/spec/stubs/custom/forecast_custom_weeks_twice.yml +0 -24
- data/spec/stubs/custom/output_custom_days.journal +0 -24
- data/spec/stubs/custom/output_custom_months.journal +0 -20
- data/spec/stubs/custom/output_custom_weeks.journal +0 -28
- data/spec/stubs/custom/output_custom_weeks_twice.journal +0 -44
- data/spec/stubs/half-yearly/forecast_half-yearly.yml +0 -10
- data/spec/stubs/half-yearly/output_half-yearly.journal +0 -20
- data/spec/stubs/modifiers/forecast_modifiers.yml +0 -13
- data/spec/stubs/modifiers/output_modifiers.journal +0 -44
- data/spec/stubs/monthly/forecast_monthly_enddate.yml +0 -14
- data/spec/stubs/monthly/forecast_monthly_enddate_top.yml +0 -14
- data/spec/stubs/monthly/forecast_monthly_modifier.yml +0 -11
- data/spec/stubs/monthly/output_monthly.journal +0 -44
- data/spec/stubs/monthly/output_monthly_enddate.journal +0 -48
- data/spec/stubs/monthly/output_monthly_enddate_top.journal +0 -40
- data/spec/stubs/monthly/output_monthly_modifier.journal +0 -20
- data/spec/stubs/once/forecast_once.yml +0 -10
- data/spec/stubs/once/output_once.journal +0 -12
- data/spec/stubs/quarterly/forecast_quarterly.yml +0 -10
- data/spec/stubs/quarterly/output_quarterly.journal +0 -20
- data/spec/stubs/start_date/forecast_startdate.yml +0 -26
- data/spec/stubs/start_date/output_startdate.journal +0 -56
- data/spec/stubs/transactions.journal +0 -8
- data/spec/stubs/yearly/forecast_yearly.yml +0 -10
- data/spec/stubs/yearly/output_yearly.journal +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb90937d10de71d495146036711f7028d12de7f5b7c814ccf0fb62dc7ffc5e7f
|
4
|
+
data.tar.gz: 05143fad945647f27f30e49626974ec62b66074863a5f11e86898a824b182c85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00e039f29f6f50237d4bca32d8f5e2f27173ac880661bb1445558a98380816de0718e3e748b639e7018d79b49ce019f6dac7b145b98104a687d04bbf36c8db57
|
7
|
+
data.tar.gz: 233262e4e1a0612c821334f97599a0d2b00962968a18f591eb5cd96f4efdd5116c037e5b5570f2b6c3e74b1955dec140ffd774a7c04feacdb6d628303d71cb87
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -2,14 +2,15 @@
|
|
2
2
|
|
3
3
|
[](https://github.com/olimorris/hledger-forecast/actions/workflows/ci.yml)
|
4
4
|
|
5
|
-
Uses a YAML file to generate
|
5
|
+
A wrapper which builds on [hledger's](https://github.com/simonmichael/hledger) [forecasting](https://hledger.org/dev/hledger.html#forecasting) capability. Uses a `YAML` config file to generate forecasts whilst adding functionality for future cost rises (e.g. inflation) and the automatic tracking of planned transactions.
|
6
6
|
|
7
7
|
See the [rationale](#brain-rationale) section for why this gem may be useful to you.
|
8
8
|
|
9
9
|
## :sparkles: Features
|
10
10
|
|
11
|
-
- :book: Uses simple YAML files to generate forecasts
|
12
|
-
- :date:
|
11
|
+
- :book: Uses simple YAML files to generate forecasts which can be used with hledger
|
12
|
+
- :date: Can smartly track forecasted transactions against actuals
|
13
|
+
- :moneybag: Can automatically apply modifiers such as inflation/deflation to forecasts
|
13
14
|
- :heavy_dollar_sign: Full currency support (uses the [RubyMoney](https://github.com/RubyMoney/money) gem)
|
14
15
|
- :computer: Simple and easy to use CLI
|
15
16
|
- :chart_with_upwards_trend: Summarize your forecasts by period and category and output to the CLI
|
@@ -24,58 +25,81 @@ Assuming you have Ruby and [Rubygems](http://rubygems.org/pages/download) instal
|
|
24
25
|
|
25
26
|
Run:
|
26
27
|
|
27
|
-
hledger-forecast
|
28
|
+
hledger-forecast
|
28
29
|
|
29
|
-
|
30
|
+
The available options are:
|
30
31
|
|
31
|
-
|
32
|
+
Usage: hledger-forecast [command] [options]
|
32
33
|
|
33
|
-
|
34
|
+
Commands:
|
35
|
+
generate Generate the forecast file
|
36
|
+
summarize Summarize the forecast file and output to the terminal
|
34
37
|
|
35
|
-
|
36
|
-
-f, --forecast FILE The FORECAST yaml file to generate from
|
37
|
-
-o, --output-file FILE The OUTPUT file to create
|
38
|
-
-s, --start-date DATE The date to start generating from (yyyy-mm-dd)
|
39
|
-
-e, --end-date DATE The date to start generating to (yyyy-mm-dd)
|
40
|
-
--force Force an overwrite of the output file
|
38
|
+
Options:
|
41
39
|
-h, --help Show this help message
|
40
|
+
-v, --version Show version
|
42
41
|
|
43
|
-
|
42
|
+
### Generate command
|
44
43
|
|
45
|
-
|
44
|
+
The `hledger-forecast generate` command will begin the generation of your forecast _from_ a `yaml` file _to_ a journal file.
|
46
45
|
|
47
|
-
|
46
|
+
The available options are:
|
47
|
+
|
48
|
+
Usage: hledger-forecast generate [options]
|
49
|
+
|
50
|
+
-f, --forecast FILE The path to the FORECAST yaml file to generate from
|
51
|
+
-o, --output-file FILE The path to the OUTPUT file to create
|
52
|
+
-t, --transaction FILE The path to the TRANSACTION journal file
|
53
|
+
--force Force an overwrite of the output file
|
54
|
+
--no-track Don't track any transactions
|
55
|
+
-h, --help Show this help message
|
56
|
+
|
57
|
+
> **Note**: For the tracking of transactions you need to include the `-t` flag
|
58
|
+
|
59
|
+
Running the command with no options will assume a `forecast.yml` file exists.
|
48
60
|
|
49
61
|
### Using with Hledger
|
50
62
|
|
51
|
-
To use the
|
63
|
+
To work with hledger, include the forecast file and use the `--forecast` flag:
|
64
|
+
|
65
|
+
hledger -f bank_transactions.journal -f forecast.journal --forecast bal assets -e 2024-02
|
66
|
+
|
67
|
+
The command will generate a forecast up to the end of Feb 2024, showing the balance for any asset accounts, overlaying some bank transactions with the forecast journal file. Of course, refer to the [hledger](https://hledger.org/dev/hledger.html) documentation for more information on how to query your finances.
|
68
|
+
|
69
|
+
To apply any modifiers, use the `--auto` flag at the end of your command.
|
70
|
+
|
71
|
+
### Summarize command
|
72
|
+
|
73
|
+
As your `yaml` configuration file grows, it can be helpful to sum up the total amounts and output them to the CLI. This can be achieved by:
|
74
|
+
|
75
|
+
hledger-forecast summarize -f my_forecast.yml
|
52
76
|
|
53
|
-
|
77
|
+
The available options are:
|
54
78
|
|
55
|
-
|
79
|
+
Usage: hledger-forecast summarize [options]
|
56
80
|
|
57
|
-
-
|
58
|
-
-
|
81
|
+
-f, --forecast FILE The path to the FORECAST yaml file to summarize
|
82
|
+
-h, --help Show this help message
|
59
83
|
|
60
84
|
## :gear: Configuration
|
61
85
|
|
62
86
|
### The YAML file
|
63
87
|
|
64
|
-
> **Note**: See the [example.yml](https://github.com/olimorris/hledger-forecast/blob/main/example.yml) file for an example of a complex config file
|
88
|
+
> **Note**: See the [example.yml](https://github.com/olimorris/hledger-forecast/blob/main/example.yml) file for an example of a complex config file and its [output](https://github.com/olimorris/hledger-forecast/blob/main/example.journal)
|
65
89
|
|
66
|
-
Firstly, create a `
|
90
|
+
Firstly, create a `yaml` file which will contain the transactions you'd like to forecast:
|
67
91
|
|
68
92
|
```yaml
|
69
93
|
# forecast.yml
|
70
94
|
monthly:
|
71
|
-
- account: "
|
72
|
-
|
95
|
+
- account: "Assets:Bank"
|
96
|
+
from: "2023-03-01"
|
73
97
|
transactions:
|
74
98
|
- amount: 2000
|
75
|
-
category: "
|
99
|
+
category: "Expenses:Mortgage"
|
76
100
|
description: Mortgage
|
77
101
|
- amount: 500
|
78
|
-
category: "
|
102
|
+
category: "Expenses:Food"
|
79
103
|
description: Food
|
80
104
|
|
81
105
|
settings:
|
@@ -84,45 +108,38 @@ settings:
|
|
84
108
|
|
85
109
|
Let's examine what's going on in this config file:
|
86
110
|
|
87
|
-
-
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
111
|
+
- We're telling the app to create two monthly transactions and repeat them, forever, starting from March 2023
|
112
|
+
- We're telling the app to link them both to the `Assets:Bank` account
|
113
|
+
- We've added descriptions to make it easy to follow in our output file
|
114
|
+
- Finally, we're telling the app to use the `GBP` currency; the default (`USD`) will be used if this is not specified
|
91
115
|
|
92
116
|
### Periods
|
93
117
|
|
94
118
|
Besides monthly recurring transactions, the app also supports the following periods:
|
95
119
|
|
96
|
-
- `quarterly` - For transactions every _3 months_
|
97
|
-
- `half-yearly` - For transactions every _6 months_
|
98
|
-
- `yearly` - Generate transactions _once a year_
|
120
|
+
- `quarterly` - For transactions every _3 months_
|
121
|
+
- `half-yearly` - For transactions every _6 months_
|
122
|
+
- `yearly` - Generate transactions _once a year_
|
99
123
|
- `once` - Generate _one-time_ transactions on a specified date
|
100
124
|
- `custom` - Generate transactions every _n days/weeks/months_
|
101
125
|
|
126
|
+
These will write periodic transactions such as `~ every 3 months` or `~ every year` in the output journal file.
|
127
|
+
|
102
128
|
#### Custom period
|
103
129
|
|
104
|
-
|
130
|
+
When you need a bespoke time bound forecast, a custom period may be useful. Custom periods allow you to specify a periodic rule as per hledger's [periodic rule syntax](https://hledger.org/dev/hledger.html#periodic-transactions):
|
105
131
|
|
106
132
|
```yaml
|
107
133
|
custom:
|
108
|
-
-
|
109
|
-
|
110
|
-
|
111
|
-
quantity: 2
|
112
|
-
account: "[Assets:Bank]"
|
113
|
-
start: "2023-03-01"
|
134
|
+
- frequency: "every 2 weeks"
|
135
|
+
account: "Assets:Bank"
|
136
|
+
from: "2023-03-01"
|
114
137
|
transactions:
|
115
138
|
- amount: 80
|
116
|
-
category: "
|
139
|
+
category: "Expenses:Personal Care"
|
117
140
|
description: Hair and beauty
|
118
141
|
```
|
119
142
|
|
120
|
-
Where `quantity` is an integer and `period` is one of:
|
121
|
-
|
122
|
-
- days
|
123
|
-
- weeks
|
124
|
-
- months
|
125
|
-
|
126
143
|
### Dates
|
127
144
|
|
128
145
|
The core of any solid forecast is predicting the correct periods that costs will fall into. When running the app from the CLI, you can specify specific dates to generate transactions over (see the [usage](#rocket-usage) section).
|
@@ -131,34 +148,97 @@ You can further control the dates at a period/top-level as well as at a transact
|
|
131
148
|
|
132
149
|
#### Top level
|
133
150
|
|
134
|
-
In the example below, all transactions in the `monthly` block will be constrained by the
|
151
|
+
In the example below, all transactions in the `monthly` block will be constrained by the `to` date:
|
135
152
|
|
136
153
|
```yaml
|
137
154
|
monthly:
|
138
|
-
- account: "
|
139
|
-
|
140
|
-
|
155
|
+
- account: "Assets:Bank"
|
156
|
+
from: "2023-03-01"
|
157
|
+
to: "2025-01-01"
|
141
158
|
transactions:
|
142
159
|
# details omitted for brevity
|
143
160
|
```
|
144
161
|
|
145
162
|
#### Transaction level
|
146
163
|
|
147
|
-
In the example below, only the single transaction will be constrained by the
|
164
|
+
In the example below, only the single transaction will be constrained by the `to` date:
|
148
165
|
|
149
166
|
```yaml
|
150
167
|
monthly:
|
151
|
-
- account: "
|
152
|
-
|
168
|
+
- account: "Assets:Bank"
|
169
|
+
from: "2023-03-01"
|
153
170
|
transactions:
|
154
171
|
- amount: 2000
|
155
|
-
category: "
|
172
|
+
category: "Expenses:Mortgage"
|
156
173
|
description: Mortgage
|
157
|
-
|
158
|
-
|
174
|
+
to: "2025-01-01"
|
175
|
+
```
|
176
|
+
|
177
|
+
### Tracking transactions
|
178
|
+
|
179
|
+
> **Note**: Marking a transaction for tracking will ensure that it is only written into the forecast if it isn't found within a specified transaction file
|
180
|
+
|
181
|
+
Sometimes it can be useful to track and monitor forecasted transactions to ensure that they are accounted for in any financial projections. If they are present, then these should be discarded from your forecast as this will create a double count against your actuals. However, if they can't be found then they should be carried forward into a future period to ensure accurate recording.
|
182
|
+
|
183
|
+
To mark transactions as available for tracking you may use the `track` option in your config file:
|
184
|
+
|
185
|
+
```yaml
|
186
|
+
once:
|
187
|
+
account: "Assets:Bank"
|
188
|
+
from: "2023-03-05"
|
189
|
+
transactions:
|
190
|
+
- amount: 3000
|
191
|
+
category: "Expenses:Shopping"
|
192
|
+
description: Refund for that damn laptop
|
193
|
+
track: true
|
194
|
+
```
|
195
|
+
|
196
|
+
> **Note**: This feature has been designed to work with one-off transactions only
|
197
|
+
|
198
|
+
To use this feature, ensure you pass a filepath to the `-t` flag, such as:
|
199
|
+
|
200
|
+
hledger-forecast generate -t [journal_file_to_search] -f [path_to_yaml_file] -o [path_to_output_journal]
|
201
|
+
|
202
|
+
The app will use a hledger query to determine if the combination of category and amount is present in the periods between the `from` key and the current date in the journal file you've specified. If not, then the app will include it as a forecast transaction in the output file.
|
203
|
+
|
204
|
+
### Applying modifiers
|
205
|
+
|
206
|
+
> **Note**: For modifiers to be included in your hledger reporting, use the `--auto` flag
|
207
|
+
|
208
|
+
Within your forecasts, it can be useful to reflect future increases/decreases in certain categories. For example, next year, I expect the cost of groceries to increase by 2%:
|
209
|
+
|
210
|
+
```yaml
|
211
|
+
monthly:
|
212
|
+
account: "Assets:Bank"
|
213
|
+
from: "2023-03-05"
|
214
|
+
transactions:
|
215
|
+
- amount: 450
|
216
|
+
category: "Expenses:Groceries"
|
217
|
+
description: Food shopping
|
218
|
+
modifiers:
|
219
|
+
- amount: 0.02
|
220
|
+
description: "Inflation"
|
221
|
+
from: "2024-01-01"
|
222
|
+
to: "2024-12-31"
|
159
223
|
```
|
160
224
|
|
161
|
-
|
225
|
+
This will generate an [auto-posting](https://hledger.org/dev/hledger.html#auto-postings) in your forecast which will
|
226
|
+
uplift any transaction with an `Expenses:Groceries` category.
|
227
|
+
|
228
|
+
Of course you may wish to apply 2% for next year and another 3% for the year after:
|
229
|
+
|
230
|
+
```yaml
|
231
|
+
# details above omitted for brevity
|
232
|
+
modifiers:
|
233
|
+
- amount: 0.02
|
234
|
+
description: "Inflation"
|
235
|
+
from: "2024-01-01"
|
236
|
+
to: "2024-12-31"
|
237
|
+
- amount: 0.05
|
238
|
+
description: "Inflation"
|
239
|
+
from: "2025-01-01"
|
240
|
+
to: "2025-12-31"
|
241
|
+
```
|
162
242
|
|
163
243
|
### Additional settings
|
164
244
|
|
@@ -168,28 +248,27 @@ Additional settings in the config file to consider:
|
|
168
248
|
settings:
|
169
249
|
currency: GBP # Specify the currency to use
|
170
250
|
show_symbol: true # Show the currency symbol?
|
171
|
-
sign_before_symbol: true # Show the negative sign before the symbol?
|
172
251
|
thousands_separator: true # Separate thousands with a comma?
|
173
252
|
```
|
174
253
|
|
175
|
-
## :
|
254
|
+
## :camera_flash: Screenshots
|
176
255
|
|
177
|
-
|
256
|
+
**Yaml config file and output**
|
178
257
|
|
179
|
-
|
258
|
+
<img src="https://user-images.githubusercontent.com/9512444/234382872-b81ac84d-2bcc-4488-a041-364f72627087.png" alt="Hledger-Forecast" />
|
180
259
|
|
181
|
-
|
260
|
+
**Summarize command**
|
182
261
|
|
183
|
-
|
262
|
+
<img src="https://user-images.githubusercontent.com/9512444/234386807-1301c8d9-af77-4f58-a3c3-a345b5e890a2.png" alt="Summarize command" />
|
184
263
|
|
185
|
-
## :
|
264
|
+
## :paintbrush: Rationale
|
186
265
|
|
187
|
-
Firstly, I've come to realise from reading countless blog and Reddit posts on [plain text accounting](https://plaintextaccounting.org), that everyone does it __completely__ differently!
|
266
|
+
Firstly, I've come to realise from reading countless blog and Reddit posts on [plain text accounting](https://plaintextaccounting.org), that everyone does it __completely__ differently! There is _great_ support in hledger for [forecasting](https://hledger.org/1.29/hledger.html#forecasting) using periodic transactions. Infact, it's nearly perfect for my needs. My only wishes were to be able to sum up monthly transactions much faster (so I can see my forecasted monthly I&E), apply future cost pressures more easily (such as inflation) and to be able to track and monitor specific transactions.
|
188
267
|
|
189
|
-
|
268
|
+
Regarding the latter; I may be expecting a material amount of money to leave my account in May (perhaps for a holiday booking). But maybe, that booking ends up leaving in July instead. Whilst I would have accounted for that expense in my forecast, it will likely be for the period of May. So if that transaction doesn't appear in the "actuals" of my May bank statement (which I import into hledger), it won't be included in my forecast at all (as the latest transaction period will be greater than the forecast period). The impact is that my forecasted balance in any future month could be $X better off than reality. Being able to automatically look out for these transactions is a nice time saver.
|
190
269
|
|
191
|
-
|
270
|
+
Also, I like to look ahead up to 3 years at a time and understand what my bank balances might look like. For this to be really accurate, factors such as inflation and salary expectations should be included. This is where the idea for modifiers came in. Being able to apply a percentage to a given category between two dates and automatically have the impact included any extended forecasts.
|
192
271
|
|
193
|
-
|
272
|
+
Now I'll freely admit these are two minor issues. So minor infact that they can probably be addressed by a dedicated 5 minutes every month as part of your hledger workflow. However I liked the idea of automating as much of my month end process as possible and saw this as an interesting challenge to try and solve.
|
194
273
|
|
195
|
-
|
274
|
+
Whilst I tried to work within the constraints of a `journal` file, moving to a `yaml` format made the implementation of these features much easier and allowed me to stay true to how you'd accomplish forecasting in hledger, manually. Whilst the config file can end up being many lines long, the output journal should be relatively streamlined and easy to follow.
|
data/example.journal
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
~ monthly from 2023-03-01 * Bonus, Salary, Food, New cell phone
|
2
|
+
Income:Bonus £-100.00 ; Bonus
|
3
|
+
Income:Salary £-2,000.00; Salary
|
4
|
+
Expenses:Food £500.00 ; Food
|
5
|
+
Expenses:Phone £75.00 ; New cell phone
|
6
|
+
Assets:Bank
|
7
|
+
|
8
|
+
~ monthly from 2023-03-01 to 2024-01-01 * Mortgage
|
9
|
+
Expenses:Mortgage £1,000.00 ; Mortgage
|
10
|
+
Assets:Bank
|
11
|
+
|
12
|
+
~ monthly from 2023-03-01 * Pension draw down
|
13
|
+
Income:Pension £-500.00 ; Pension draw down
|
14
|
+
Assets:Savings
|
15
|
+
|
16
|
+
~ every 3 months from 2023-04-01 * Bonus
|
17
|
+
Income:Bonus £-1,000.00; Bonus
|
18
|
+
Assets:Bank
|
19
|
+
|
20
|
+
~ every 6 months from 2023-04-01 * Holiday
|
21
|
+
Expenses:Holiday £500.00 ; Holiday
|
22
|
+
Assets:Bank
|
23
|
+
|
24
|
+
~ yearly from 2023-04-01 * Annual Bonus
|
25
|
+
Income:Bonus £-2,000.00; Annual Bonus
|
26
|
+
Assets:Bank
|
27
|
+
|
28
|
+
~ every 5 days from 2023-03-01 * Car fuel
|
29
|
+
Expenses:Car:Fuel £150.00 ; Car fuel
|
30
|
+
Assets:Bank
|
31
|
+
|
32
|
+
= Expenses:Food date:2024-01-01..2024-12-31
|
33
|
+
Expenses:Food *0.1 ; Food - Inflation
|
34
|
+
Assets:Bank *-0.1
|
35
|
+
|
data/example.yml
CHANGED
@@ -1,77 +1,76 @@
|
|
1
1
|
monthly:
|
2
|
-
- account: "
|
3
|
-
|
2
|
+
- account: "Assets:Bank"
|
3
|
+
from: "2023-03-01"
|
4
4
|
transactions:
|
5
5
|
- amount: -100
|
6
|
-
category: "
|
6
|
+
category: "Income:Bonus"
|
7
7
|
description: Bonus
|
8
8
|
- amount: -2000
|
9
|
-
category: "
|
9
|
+
category: "Income:Salary"
|
10
10
|
description: Salary
|
11
|
-
- amount: 500
|
12
|
-
category: "
|
11
|
+
- amount: 500
|
12
|
+
category: "Expenses:Food"
|
13
13
|
description: Food
|
14
|
+
modifiers:
|
15
|
+
- amount: 0.1
|
16
|
+
description: "Inflation"
|
17
|
+
from: "2024-01-01"
|
18
|
+
to: "2024-12-31"
|
14
19
|
- amount: 75
|
15
|
-
category: "
|
20
|
+
category: "Expenses:Phone"
|
16
21
|
description: New cell phone
|
17
|
-
|
18
|
-
|
19
|
-
category: "[Expenses:Mortgage]"
|
22
|
+
- amount: 1000
|
23
|
+
category: "Expenses:Mortgage"
|
20
24
|
description: Mortgage
|
21
|
-
|
22
|
-
- account: "
|
23
|
-
|
25
|
+
to: "2024-01-01"
|
26
|
+
- account: "Assets:Savings"
|
27
|
+
from: "2023-03-01"
|
24
28
|
transactions:
|
25
29
|
- amount: -500
|
26
|
-
category: "
|
30
|
+
category: "Income:Pension"
|
27
31
|
description: Pension draw down
|
28
32
|
|
29
33
|
quarterly:
|
30
|
-
- account: "
|
31
|
-
|
34
|
+
- account: "Assets:Bank"
|
35
|
+
from: "2023-04-01"
|
32
36
|
transactions:
|
33
37
|
- amount: -1000.00
|
34
|
-
category: "
|
38
|
+
category: "Income:Bonus"
|
35
39
|
description: Bonus
|
36
40
|
|
37
41
|
half-yearly:
|
38
|
-
- account: "
|
39
|
-
|
42
|
+
- account: "Assets:Bank"
|
43
|
+
from: "2023-04-01"
|
40
44
|
transactions:
|
41
45
|
- amount: 500
|
42
|
-
category: "
|
46
|
+
category: "Expenses:Holiday"
|
43
47
|
description: Holiday
|
44
48
|
|
45
49
|
yearly:
|
46
|
-
- account: "
|
47
|
-
|
50
|
+
- account: "Assets:Bank"
|
51
|
+
from: "2023-04-01"
|
48
52
|
transactions:
|
49
53
|
- amount: -2000.00
|
50
|
-
category: "
|
54
|
+
category: "Income:Bonus"
|
51
55
|
description: Annual Bonus
|
52
56
|
|
53
57
|
once:
|
54
|
-
- account: "
|
55
|
-
|
58
|
+
- account: "Assets:Bank"
|
59
|
+
from: "2023-03-01"
|
56
60
|
transactions:
|
57
61
|
- amount: 5000.00
|
58
|
-
category: "
|
62
|
+
category: "Expenses:Car"
|
59
63
|
description: Forecast new car cost
|
64
|
+
track: true
|
60
65
|
|
61
66
|
custom:
|
62
|
-
-
|
63
|
-
|
64
|
-
|
65
|
-
quantity: 5
|
66
|
-
account: "[Assets:Bank]"
|
67
|
-
start: "2023-03-01"
|
67
|
+
- frequency: "every 5 days"
|
68
|
+
account: "Assets:Bank"
|
69
|
+
from: "2023-03-01"
|
68
70
|
transactions:
|
69
71
|
- amount: 150
|
70
|
-
category: "
|
72
|
+
category: "Expenses:Car:Fuel"
|
71
73
|
description: Car fuel
|
72
74
|
|
73
75
|
settings:
|
74
76
|
currency: GBP
|
75
|
-
show_symbol: true
|
76
|
-
sign_before_symbol: true
|
77
|
-
thousands_separator: true
|
data/hledger-forecast.gemspec
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
lib = File.expand_path('
|
1
|
+
lib = File.expand_path('lib', __dir__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
+
|
3
4
|
require 'hledger_forecast/version'
|
4
5
|
|
5
6
|
Gem::Specification.new do |s|
|
6
7
|
s.name = 'hledger-forecast'
|
7
8
|
s.version = HledgerForecast::VERSION
|
8
9
|
s.authors = ['Oli Morris']
|
9
|
-
s.summary =
|
10
|
-
s.description = 'Uses a YAML file to generate
|
10
|
+
s.summary = "An extended wrapper around hledger's forecasting functionality"
|
11
|
+
s.description = 'Uses a YAML file to generate forecasts which can be used to extend the default functionality in hledger'
|
11
12
|
s.email = 'olimorris@users.noreply.github.com'
|
12
13
|
s.homepage = 'https://github.com/olimorris/hledger-forecast'
|
13
14
|
s.license = 'MIT'
|
14
15
|
|
16
|
+
s.add_dependency "colorize", "~> 0.8.1"
|
15
17
|
s.add_dependency "highline", "~> 2.1.0"
|
16
18
|
s.add_dependency "money", "~> 6.16.0"
|
17
|
-
s.add_dependency "colorize", "~> 0.8.1"
|
18
19
|
s.add_dependency "terminal-table", "~> 3.0.2"
|
19
20
|
s.add_development_dependency 'rspec', '~> 3.12'
|
20
21
|
|