hledger-forecast 0.1.0 → 0.1.2
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/.github/workflows/ci.yml +5 -9
- data/.gitignore +1 -1
- data/Gemfile.lock +2 -1
- data/README.md +3 -1
- data/example.yml +40 -0
- data/hledger-forecast.gemspec +2 -0
- data/lib/hledger_forecast/version.rb +1 -1
- data/spec/stubs/monthly/output_monthly.journal +32 -0
- data/spec/stubs/monthly/output_monthly_enddate.journal +48 -0
- data/spec/stubs/monthly/output_monthly_enddate_top.journal +40 -0
- data/spec/stubs/monthly/output_monthly_modifier.journal +20 -0
- data/spec/stubs/once/output_once.journal +12 -0
- data/spec/stubs/quarterly/output_quarterly.journal +20 -0
- data/spec/stubs/yearly/output_yearly.journal +16 -0
- metadata +16 -2
- data/example.yaml +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9772d5b27c6f2d9b34bd63b32fe03451b74d9174d9144b33821ca80615c25855
|
4
|
+
data.tar.gz: d4590bb0b96d7d507fb5ebc7c97c0bdd0186cc2cefeca431033352ab69166f56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 739a2154d80fca8055cce38203a7b024215653e2f7b601916d963dae01e5a644e54910169a04608e8629ed1724eb0f23451b0d77b19f41e27b78f4e8e41b2400
|
7
|
+
data.tar.gz: 04dd3dd1ec44b2db053f7d25b8357c2eab54b801d6ad4875a92ca0965892143c037f4b6e54a85480080158e500e31547d2c93d2dc0f1197c9e5213044ae64281
|
data/.github/workflows/ci.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: Tests
|
2
2
|
|
3
3
|
on:
|
4
4
|
pull_request:
|
@@ -8,26 +8,22 @@ on:
|
|
8
8
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
|
+
|
11
12
|
runs-on: ubuntu-latest
|
12
13
|
strategy:
|
13
14
|
matrix:
|
14
|
-
ruby-version:
|
15
|
-
- 3.1.2
|
16
|
-
- 3.0
|
15
|
+
ruby-version: ['3.0', '3.1', '3.2']
|
17
16
|
|
18
17
|
steps:
|
19
18
|
- uses: actions/checkout@v3
|
20
|
-
- name: Update
|
19
|
+
- name: Update packages
|
21
20
|
run: sudo apt-get update
|
22
21
|
- name: Install packages
|
23
22
|
run: sudo apt-get -y install ledger hledger
|
24
23
|
- name: Set up Ruby
|
25
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
26
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
27
24
|
uses: ruby/setup-ruby@v1
|
28
|
-
# uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
29
25
|
with:
|
30
26
|
bundler-cache: true # runs 'bundle install' and caches installed gems
|
31
27
|
ruby-version: ${{ matrix.ruby-version }}
|
32
28
|
- name: Run tests
|
33
|
-
run: rspec
|
29
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Hledger-Forecast
|
2
2
|
|
3
|
-

|
3
|
+
[](https://github.com/olimorris/hledger-forecast/actions/workflows/ci.yml)
|
4
4
|
|
5
5
|
> **Warning**: This is still in the early stages of development and the API is likely to change
|
6
6
|
|
@@ -47,6 +47,8 @@ where `transactions.journal` might be your bank transactions (your "actuals") an
|
|
47
47
|
|
48
48
|
### A simple config file
|
49
49
|
|
50
|
+
> **Note**: See the [example.yml](https://github.com/olimorris/hledger-forecast/blob/main/example.yml) file for all of the options
|
51
|
+
|
50
52
|
Firstly, create a `yml` file which will contain the transactions you'd like to forecast:
|
51
53
|
|
52
54
|
```yaml
|
data/example.yml
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
monthly:
|
2
|
+
- account: "[Assets:Bank]"
|
3
|
+
date: "2023-03-01"
|
4
|
+
transactions:
|
5
|
+
- amount: 1000.00
|
6
|
+
category: "[Expenses:Mortgage]"
|
7
|
+
description: Mortgage
|
8
|
+
- amount: 500.00
|
9
|
+
category: "[Expenses:Food]"
|
10
|
+
description: Food
|
11
|
+
|
12
|
+
quarterly:
|
13
|
+
- account: "[Assets:Bank]"
|
14
|
+
date: "2023-04-01"
|
15
|
+
transactions:
|
16
|
+
- amount: -1000.00
|
17
|
+
category: "[Income:Bonus]"
|
18
|
+
description: Bonus
|
19
|
+
|
20
|
+
yearly:
|
21
|
+
- account: "[Assets:Bank]"
|
22
|
+
date: "2023-04-01"
|
23
|
+
transactions:
|
24
|
+
- amount: -2000.00
|
25
|
+
category: "[Income:Bonus]"
|
26
|
+
description: Annual Bonus
|
27
|
+
|
28
|
+
once:
|
29
|
+
- account: "[Assets:Bank]"
|
30
|
+
date: "2024-01-01"
|
31
|
+
transactions:
|
32
|
+
- amount: 5000.00
|
33
|
+
category: "[Expenses:Car]"
|
34
|
+
description: Forecast new car cost
|
35
|
+
|
36
|
+
settings:
|
37
|
+
currency: GBP
|
38
|
+
show_symbol: false
|
39
|
+
sign_before_symbol: true
|
40
|
+
thousands_separator: false
|
data/hledger-forecast.gemspec
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-03-01 * Mortgage
|
10
|
+
[Expenses:Mortgage] £2,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2023-03-01 * Food
|
14
|
+
[Expenses:Food] £100.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
17
|
+
2023-04-01 * Mortgage
|
18
|
+
[Expenses:Mortgage] £2,000.00
|
19
|
+
[Assets:Bank]
|
20
|
+
|
21
|
+
2023-04-01 * Food
|
22
|
+
[Expenses:Food] £100.00
|
23
|
+
[Assets:Bank]
|
24
|
+
|
25
|
+
2023-05-01 * Mortgage
|
26
|
+
[Expenses:Mortgage] £2,000.00
|
27
|
+
[Assets:Bank]
|
28
|
+
|
29
|
+
2023-05-01 * Food
|
30
|
+
[Expenses:Food] £100.00
|
31
|
+
[Assets:Bank]
|
32
|
+
|
@@ -0,0 +1,48 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-03-01 * Mortgage
|
10
|
+
[Expenses:Mortgage] £2,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2023-03-01 * Food
|
14
|
+
[Expenses:Food] £100.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
17
|
+
2023-04-01 * Mortgage
|
18
|
+
[Expenses:Mortgage] £2,000.00
|
19
|
+
[Assets:Bank]
|
20
|
+
|
21
|
+
2023-04-01 * Food
|
22
|
+
[Expenses:Food] £100.00
|
23
|
+
[Assets:Bank]
|
24
|
+
|
25
|
+
2023-05-01 * Mortgage
|
26
|
+
[Expenses:Mortgage] £2,000.00
|
27
|
+
[Assets:Bank]
|
28
|
+
|
29
|
+
2023-05-01 * Food
|
30
|
+
[Expenses:Food] £100.00
|
31
|
+
[Assets:Bank]
|
32
|
+
|
33
|
+
2023-06-01 * Mortgage
|
34
|
+
[Expenses:Mortgage] £2,000.00
|
35
|
+
[Assets:Bank]
|
36
|
+
|
37
|
+
2023-06-01 * Food
|
38
|
+
[Expenses:Food] £100.00
|
39
|
+
[Assets:Bank]
|
40
|
+
|
41
|
+
2023-07-01 * Food
|
42
|
+
[Expenses:Food] £100.00
|
43
|
+
[Assets:Bank]
|
44
|
+
|
45
|
+
2023-08-01 * Food
|
46
|
+
[Expenses:Food] £100.00
|
47
|
+
[Assets:Bank]
|
48
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-03-01 * Mortgage
|
10
|
+
[Expenses:Mortgage] £2,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2023-03-01 * Food
|
14
|
+
[Expenses:Food] £100.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
17
|
+
2023-04-01 * Mortgage
|
18
|
+
[Expenses:Mortgage] £2,000.00
|
19
|
+
[Assets:Bank]
|
20
|
+
|
21
|
+
2023-04-01 * Food
|
22
|
+
[Expenses:Food] £100.00
|
23
|
+
[Assets:Bank]
|
24
|
+
|
25
|
+
2023-05-01 * Mortgage
|
26
|
+
[Expenses:Mortgage] £2,000.00
|
27
|
+
[Assets:Bank]
|
28
|
+
|
29
|
+
2023-05-01 * Food
|
30
|
+
[Expenses:Food] £100.00
|
31
|
+
[Assets:Bank]
|
32
|
+
|
33
|
+
2023-06-01 * Mortgage
|
34
|
+
[Expenses:Mortgage] £2,000.00
|
35
|
+
[Assets:Bank]
|
36
|
+
|
37
|
+
2023-06-01 * Food
|
38
|
+
[Expenses:Food] £100.00
|
39
|
+
[Assets:Bank]
|
40
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-03-01 * Mortgage
|
10
|
+
[Expenses:Mortgage] £2,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2023-04-01 * Mortgage
|
14
|
+
[Expenses:Mortgage] £2,000.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
17
|
+
2023-05-01 * Mortgage
|
18
|
+
[Expenses:Mortgage] £2,000.00
|
19
|
+
[Assets:Bank]
|
20
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-04-01 * Bonus
|
10
|
+
[Income:Bonus] -£1,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2023-07-01 * Bonus
|
14
|
+
[Income:Bonus] -£1,000.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
17
|
+
2023-10-01 * Bonus
|
18
|
+
[Income:Bonus] -£1,000.00
|
19
|
+
[Assets:Bank]
|
20
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
2023-02-01 * Opening balance
|
2
|
+
Assets:Bank £1,000.00
|
3
|
+
Equity:Opening balance
|
4
|
+
|
5
|
+
2023-02-05 * Mortgage payment
|
6
|
+
Expenses:Mortgage £1,500.00
|
7
|
+
Assets:Bank
|
8
|
+
|
9
|
+
2023-04-01 * Bonus
|
10
|
+
[Income:Bonus] -£3,000.00
|
11
|
+
[Assets:Bank]
|
12
|
+
|
13
|
+
2024-04-01 * Bonus
|
14
|
+
[Income:Bonus] -£3,000.00
|
15
|
+
[Assets:Bank]
|
16
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hledger-forecast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oli Morris
|
@@ -69,7 +69,7 @@ files:
|
|
69
69
|
- LICENSE
|
70
70
|
- README.md
|
71
71
|
- bin/hledger-forecast
|
72
|
-
- example.
|
72
|
+
- example.yml
|
73
73
|
- hledger-forecast.gemspec
|
74
74
|
- lib/hledger_forecast.rb
|
75
75
|
- lib/hledger_forecast/command.rb
|
@@ -83,10 +83,17 @@ files:
|
|
83
83
|
- spec/stubs/monthly/forecast_monthly_enddate.yml
|
84
84
|
- spec/stubs/monthly/forecast_monthly_enddate_top.yml
|
85
85
|
- spec/stubs/monthly/forecast_monthly_modifier.yml
|
86
|
+
- spec/stubs/monthly/output_monthly.journal
|
87
|
+
- spec/stubs/monthly/output_monthly_enddate.journal
|
88
|
+
- spec/stubs/monthly/output_monthly_enddate_top.journal
|
89
|
+
- spec/stubs/monthly/output_monthly_modifier.journal
|
86
90
|
- spec/stubs/once/forecast_once.yml
|
91
|
+
- spec/stubs/once/output_once.journal
|
87
92
|
- spec/stubs/quarterly/forecast_quarterly.yml
|
93
|
+
- spec/stubs/quarterly/output_quarterly.journal
|
88
94
|
- spec/stubs/transactions.journal
|
89
95
|
- spec/stubs/yearly/forecast_yearly.yml
|
96
|
+
- spec/stubs/yearly/output_yearly.journal
|
90
97
|
- spec/yearly_spec.rb
|
91
98
|
homepage: https://github.com/olimorris/hledger-forecast
|
92
99
|
licenses:
|
@@ -119,8 +126,15 @@ test_files:
|
|
119
126
|
- spec/stubs/monthly/forecast_monthly_enddate.yml
|
120
127
|
- spec/stubs/monthly/forecast_monthly_enddate_top.yml
|
121
128
|
- spec/stubs/monthly/forecast_monthly_modifier.yml
|
129
|
+
- spec/stubs/monthly/output_monthly.journal
|
130
|
+
- spec/stubs/monthly/output_monthly_enddate.journal
|
131
|
+
- spec/stubs/monthly/output_monthly_enddate_top.journal
|
132
|
+
- spec/stubs/monthly/output_monthly_modifier.journal
|
122
133
|
- spec/stubs/once/forecast_once.yml
|
134
|
+
- spec/stubs/once/output_once.journal
|
123
135
|
- spec/stubs/quarterly/forecast_quarterly.yml
|
136
|
+
- spec/stubs/quarterly/output_quarterly.journal
|
124
137
|
- spec/stubs/transactions.journal
|
125
138
|
- spec/stubs/yearly/forecast_yearly.yml
|
139
|
+
- spec/stubs/yearly/output_yearly.journal
|
126
140
|
- spec/yearly_spec.rb
|
data/example.yaml
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
monthly:
|
2
|
-
- date: "2023-03-01"
|
3
|
-
account: "[Assets:Bank]"
|
4
|
-
transactions:
|
5
|
-
- description: Mortgage
|
6
|
-
category: "[Expenses:Mortgage]"
|
7
|
-
amount: £1,000.00
|
8
|
-
- description: Food
|
9
|
-
category: "[Expenses:Food]"
|
10
|
-
amount: £500.00
|
11
|
-
|
12
|
-
quarterly:
|
13
|
-
- date: "2023-04-01"
|
14
|
-
account: "[Assets:Bank]"
|
15
|
-
transactions:
|
16
|
-
- description: Bonus
|
17
|
-
category: "[Income:Bonus]"
|
18
|
-
amount: -£1,000.00
|
19
|
-
|
20
|
-
yearly:
|
21
|
-
- date: "2023-04-01"
|
22
|
-
account: "[Assets:Bank]"
|
23
|
-
transactions:
|
24
|
-
- description: Annual Bonus
|
25
|
-
category: "[Income:Bonus]"
|
26
|
-
amount: -£2,000.00
|