reckon 0.6.0 → 0.7.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/ruby.yml +50 -0
- data/.gitignore +3 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +75 -7
- data/Gemfile.lock +1 -1
- data/README.md +85 -24
- data/Rakefile +17 -1
- data/bin/build-new-version.sh +26 -0
- data/bin/reckon +9 -1
- data/lib/reckon.rb +1 -0
- data/lib/reckon/app.rb +18 -141
- data/lib/reckon/cosine_similarity.rb +67 -62
- data/lib/reckon/csv_parser.rb +2 -7
- data/lib/reckon/date_column.rb +10 -0
- data/lib/reckon/money.rb +59 -52
- data/lib/reckon/options.rb +153 -0
- data/lib/reckon/version.rb +1 -1
- data/spec/cosine_training_and_test.rb +52 -0
- data/spec/integration/another_bank_example/input.csv +9 -0
- data/spec/integration/another_bank_example/output.ledger +36 -0
- data/spec/integration/another_bank_example/test_args +1 -0
- data/spec/integration/ask_for_account/cli_input.exp +33 -0
- data/spec/integration/ask_for_account/expected_output +11 -0
- data/spec/integration/ask_for_account/input.csv +9 -0
- data/spec/integration/ask_for_account/test_args +1 -0
- data/spec/integration/austrian_example/input.csv +13 -0
- data/spec/integration/austrian_example/output.ledger +52 -0
- data/spec/integration/austrian_example/test_args +2 -0
- data/spec/integration/bom_utf8_file/input.csv +3 -0
- data/spec/integration/bom_utf8_file/output.ledger +4 -0
- data/spec/integration/bom_utf8_file/test_args +3 -0
- data/spec/integration/broker_canada_example/input.csv +12 -0
- data/spec/integration/broker_canada_example/output.ledger +48 -0
- data/spec/integration/broker_canada_example/test_args +1 -0
- data/spec/integration/chase/account_tokens_and_regex/output.ledger +36 -0
- data/spec/integration/chase/account_tokens_and_regex/test_args +2 -0
- data/spec/integration/chase/account_tokens_and_regex/tokens.yml +16 -0
- data/spec/integration/chase/default_account_names/output.ledger +36 -0
- data/spec/integration/chase/default_account_names/test_args +3 -0
- data/spec/integration/chase/input.csv +9 -0
- data/spec/integration/chase/learn_from_existing/learn.ledger +7 -0
- data/spec/integration/chase/learn_from_existing/output.ledger +36 -0
- data/spec/integration/chase/learn_from_existing/test_args +1 -0
- data/spec/integration/chase/simple/output.ledger +36 -0
- data/spec/integration/chase/simple/test_args +1 -0
- data/spec/integration/danish_kroner_nordea_example/input.csv +6 -0
- data/spec/integration/danish_kroner_nordea_example/output.ledger +24 -0
- data/spec/integration/danish_kroner_nordea_example/test_args +1 -0
- data/spec/integration/english_date_example/input.csv +3 -0
- data/spec/integration/english_date_example/output.ledger +12 -0
- data/spec/integration/english_date_example/test_args +1 -0
- data/spec/integration/extratofake/input.csv +24 -0
- data/spec/integration/extratofake/output.ledger +92 -0
- data/spec/integration/extratofake/test_args +1 -0
- data/spec/integration/french_example/input.csv +9 -0
- data/spec/integration/french_example/output.ledger +36 -0
- data/spec/integration/french_example/test_args +2 -0
- data/spec/integration/german_date_example/input.csv +3 -0
- data/spec/integration/german_date_example/output.ledger +12 -0
- data/spec/integration/german_date_example/test_args +1 -0
- data/spec/integration/harder_date_example/input.csv +5 -0
- data/spec/integration/harder_date_example/output.ledger +20 -0
- data/spec/integration/harder_date_example/test_args +1 -0
- data/spec/integration/ing/input.csv +3 -0
- data/spec/integration/ing/output.ledger +12 -0
- data/spec/integration/ing/test_args +1 -0
- data/spec/integration/intuit_mint_example/input.csv +7 -0
- data/spec/integration/intuit_mint_example/output.ledger +28 -0
- data/spec/integration/intuit_mint_example/test_args +1 -0
- data/spec/integration/invalid_header_example/input.csv +6 -0
- data/spec/integration/invalid_header_example/output.ledger +8 -0
- data/spec/integration/invalid_header_example/test_args +1 -0
- data/spec/integration/inversed_credit_card/input.csv +16 -0
- data/spec/integration/inversed_credit_card/output.ledger +64 -0
- data/spec/integration/inversed_credit_card/test_args +1 -0
- data/spec/integration/nationwide/input.csv +4 -0
- data/spec/integration/nationwide/output.ledger +16 -0
- data/spec/integration/nationwide/test_args +1 -0
- data/spec/integration/regression/issue_51_account_tokens/input.csv +8 -0
- data/spec/integration/regression/issue_51_account_tokens/output.ledger +32 -0
- data/spec/integration/regression/issue_51_account_tokens/test_args +4 -0
- data/spec/integration/regression/issue_51_account_tokens/tokens.yml +9 -0
- data/spec/integration/regression/issue_64_date_column/input.csv +3 -0
- data/spec/integration/regression/issue_64_date_column/output.ledger +8 -0
- data/spec/integration/regression/issue_64_date_column/test_args +1 -0
- data/spec/integration/regression/issue_73_account_token_matching/input.csv +2 -0
- data/spec/integration/regression/issue_73_account_token_matching/output.ledger +4 -0
- data/spec/integration/regression/issue_73_account_token_matching/test_args +6 -0
- data/spec/integration/regression/issue_73_account_token_matching/tokens.yml +8 -0
- data/spec/integration/regression/issue_85_date_example/input.csv +2 -0
- data/spec/integration/regression/issue_85_date_example/output.ledger +8 -0
- data/spec/integration/regression/issue_85_date_example/test_args +1 -0
- data/spec/integration/spanish_date_example/input.csv +3 -0
- data/spec/integration/spanish_date_example/output.ledger +12 -0
- data/spec/integration/spanish_date_example/test_args +1 -0
- data/spec/integration/suntrust/input.csv +7 -0
- data/spec/integration/suntrust/output.ledger +28 -0
- data/spec/integration/suntrust/test_args +1 -0
- data/spec/integration/test.sh +123 -0
- data/spec/integration/test_money_column/input.csv +3 -0
- data/spec/integration/test_money_column/output.ledger +8 -0
- data/spec/integration/test_money_column/test_args +1 -0
- data/spec/integration/two_money_columns/input.csv +5 -0
- data/spec/integration/two_money_columns/output.ledger +20 -0
- data/spec/integration/two_money_columns/test_args +1 -0
- data/spec/integration/yyyymmdd_date_example/input.csv +1 -0
- data/spec/integration/yyyymmdd_date_example/output.ledger +4 -0
- data/spec/integration/yyyymmdd_date_example/test_args +1 -0
- data/spec/reckon/app_spec.rb +24 -6
- data/spec/reckon/csv_parser_spec.rb +3 -3
- data/spec/reckon/money_column_spec.rb +24 -24
- data/spec/reckon/money_spec.rb +15 -34
- data/spec/reckon/options_spec.rb +17 -0
- data/spec/spec_helper.rb +6 -1
- metadata +102 -7
- data/.travis.yml +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5984a4f8cd36d4e14f013c14bb111725f8681b90768b6710679820d1325a02e5
|
|
4
|
+
data.tar.gz: b392d89078a7679f01a344799512ec0467cfe8cad101374a5b8fd198c7e39480
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae9b8348e93294d45354f1b96045305dd480b23cd34dcaca3f958fcbc866582000faa1711ea6cbb552578ffe98f126943221b98af298757b86e6dfa54c623f9d
|
|
7
|
+
data.tar.gz: f43e7128e198c9b73fc40b148cbe281d0bc02aeec90d576615e24fe98789a1846553121319152bffb3a9ca966fd26e1b3916da90480979c5d55106e06dbfe7f2
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
|
2
|
+
# They are provided by a third-party and are governed by
|
|
3
|
+
# separate terms of service, privacy policy, and support
|
|
4
|
+
# documentation.
|
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
|
7
|
+
|
|
8
|
+
name: Build Status
|
|
9
|
+
|
|
10
|
+
on:
|
|
11
|
+
push:
|
|
12
|
+
branches: [ master ]
|
|
13
|
+
pull_request:
|
|
14
|
+
branches: [ master ]
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
strategy:
|
|
21
|
+
matrix:
|
|
22
|
+
ruby-version:
|
|
23
|
+
# Current ruby stable version
|
|
24
|
+
- 3.0
|
|
25
|
+
# Ubuntu 20.10
|
|
26
|
+
- 2.7
|
|
27
|
+
# Ubuntu 19.10
|
|
28
|
+
- 2.5
|
|
29
|
+
# Mac v11 Big Sur
|
|
30
|
+
# - 2.6?
|
|
31
|
+
# Mac v10.15 Catalina
|
|
32
|
+
- 2.6
|
|
33
|
+
# Mac v10.14 Mojave
|
|
34
|
+
- 2.3.7
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v2
|
|
37
|
+
- name: Update package
|
|
38
|
+
run: sudo apt-get update
|
|
39
|
+
- name: Install packages
|
|
40
|
+
run: sudo apt-get -y install ledger hledger expect
|
|
41
|
+
- name: Set up Ruby
|
|
42
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
|
43
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
|
44
|
+
uses: ruby/setup-ruby@v1
|
|
45
|
+
# uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
|
|
46
|
+
with:
|
|
47
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
48
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems
|
|
49
|
+
- name: Run tests
|
|
50
|
+
run: bundle exec rake test_all
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.0.0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,76 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [
|
|
3
|
+
## [v0.7.2](https://github.com/cantino/reckon/tree/v0.7.2) (2021-04-22)
|
|
4
4
|
|
|
5
|
-
[Full Changelog](https://github.com/cantino/reckon/compare/v0.
|
|
5
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.7.1...v0.7.2)
|
|
6
|
+
|
|
7
|
+
**Closed issues:**
|
|
8
|
+
|
|
9
|
+
- \[feature request\] Better format for large transactions [\#108](https://github.com/cantino/reckon/issues/108)
|
|
10
|
+
- cosine similarity not comparing documents correctly [\#106](https://github.com/cantino/reckon/issues/106)
|
|
11
|
+
|
|
12
|
+
**Merged pull requests:**
|
|
13
|
+
|
|
14
|
+
- Add thousands separator in money output. Fixes \#108. [\#109](https://github.com/cantino/reckon/pull/109) ([benprew](https://github.com/benprew))
|
|
15
|
+
- Cosine similarity should use all docs tokens. not just matched tokens. [\#107](https://github.com/cantino/reckon/pull/107) ([benprew](https://github.com/benprew))
|
|
16
|
+
- Test getting expect working with actions [\#105](https://github.com/cantino/reckon/pull/105) ([benprew](https://github.com/benprew))
|
|
17
|
+
|
|
18
|
+
## [v0.7.1](https://github.com/cantino/reckon/tree/v0.7.1) (2021-02-07)
|
|
19
|
+
|
|
20
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.7.0...v0.7.1)
|
|
21
|
+
|
|
22
|
+
**Closed issues:**
|
|
23
|
+
|
|
24
|
+
- bug when asking for account name [\#103](https://github.com/cantino/reckon/issues/103)
|
|
25
|
+
|
|
26
|
+
## [v0.7.0](https://github.com/cantino/reckon/tree/v0.7.0) (2021-02-06)
|
|
27
|
+
|
|
28
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.2...v0.7.0)
|
|
29
|
+
|
|
30
|
+
**Closed issues:**
|
|
31
|
+
|
|
32
|
+
- fail on unknown accounts [\#96](https://github.com/cantino/reckon/issues/96)
|
|
33
|
+
|
|
34
|
+
**Merged pull requests:**
|
|
35
|
+
|
|
36
|
+
- Fail on unknown account [\#102](https://github.com/cantino/reckon/pull/102) ([benprew](https://github.com/benprew))
|
|
37
|
+
- Joined split sentence to one [\#101](https://github.com/cantino/reckon/pull/101) ([RidaAyed](https://github.com/RidaAyed))
|
|
38
|
+
|
|
39
|
+
## [v0.6.2](https://github.com/cantino/reckon/tree/v0.6.2) (2021-01-25)
|
|
40
|
+
|
|
41
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.1...v0.6.2)
|
|
42
|
+
|
|
43
|
+
**Closed issues:**
|
|
44
|
+
|
|
45
|
+
- spaces in tokens [\#97](https://github.com/cantino/reckon/issues/97)
|
|
46
|
+
- read from stdin [\#95](https://github.com/cantino/reckon/issues/95)
|
|
47
|
+
|
|
48
|
+
**Merged pull requests:**
|
|
49
|
+
|
|
50
|
+
- Allow using '-' as filename in -f to read csv from STDIN. Fixes \#95 [\#98](https://github.com/cantino/reckon/pull/98) ([benprew](https://github.com/benprew))
|
|
51
|
+
|
|
52
|
+
## [v0.6.1](https://github.com/cantino/reckon/tree/v0.6.1) (2021-01-23)
|
|
53
|
+
|
|
54
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.6.0...v0.6.1)
|
|
55
|
+
|
|
56
|
+
**Implemented enhancements:**
|
|
57
|
+
|
|
58
|
+
- \[Feature Request\] Note flag --add-notes in CLI to allow additional notes for each ledger entry [\#86](https://github.com/cantino/reckon/issues/86)
|
|
59
|
+
|
|
60
|
+
**Closed issues:**
|
|
61
|
+
|
|
62
|
+
- Migrate CI system from travis-ci.org [\#93](https://github.com/cantino/reckon/issues/93)
|
|
63
|
+
- \[Feature Request\] Pipe ledger file input to the bayesian predictor \(instead of csv\) [\#91](https://github.com/cantino/reckon/issues/91)
|
|
64
|
+
|
|
65
|
+
**Merged pull requests:**
|
|
66
|
+
|
|
67
|
+
- Add github actions [\#100](https://github.com/cantino/reckon/pull/100) ([benprew](https://github.com/benprew))
|
|
68
|
+
- Add documentation for doing a substring match. Fixes \#97 [\#99](https://github.com/cantino/reckon/pull/99) ([benprew](https://github.com/benprew))
|
|
69
|
+
- Test fixes [\#94](https://github.com/cantino/reckon/pull/94) ([benprew](https://github.com/benprew))
|
|
70
|
+
|
|
71
|
+
## [v0.6.0](https://github.com/cantino/reckon/tree/v0.6.0) (2020-09-04)
|
|
72
|
+
|
|
73
|
+
[Full Changelog](https://github.com/cantino/reckon/compare/v0.5.4...v0.6.0)
|
|
6
74
|
|
|
7
75
|
**Fixed bugs:**
|
|
8
76
|
|
|
@@ -82,7 +150,6 @@
|
|
|
82
150
|
- Fix bugs in ledger file parsing. Fixes \#56. [\#81](https://github.com/cantino/reckon/pull/81) ([benprew](https://github.com/benprew))
|
|
83
151
|
- Better file encoding suggestions [\#80](https://github.com/cantino/reckon/pull/80) ([benprew](https://github.com/benprew))
|
|
84
152
|
- :bug: fix matching algorithm, add logging and a spec helper. Fixes \#73 [\#79](https://github.com/cantino/reckon/pull/79) ([benprew](https://github.com/benprew))
|
|
85
|
-
- bug: invalid header lines should be ignored, not parsed. [\#78](https://github.com/cantino/reckon/pull/78) ([benprew](https://github.com/benprew))
|
|
86
153
|
- convert default date format to iso8601 [\#77](https://github.com/cantino/reckon/pull/77) ([benprew](https://github.com/benprew))
|
|
87
154
|
- Fix rspec failure for ruby 2.3 and 2.4 [\#69](https://github.com/cantino/reckon/pull/69) ([BlackEdder](https://github.com/BlackEdder))
|
|
88
155
|
- Allow setting of money and date columns by index [\#67](https://github.com/cantino/reckon/pull/67) ([cantino](https://github.com/cantino))
|
|
@@ -135,6 +202,7 @@
|
|
|
135
202
|
|
|
136
203
|
**Merged pull requests:**
|
|
137
204
|
|
|
205
|
+
- bug: invalid header lines should be ignored, not parsed. [\#78](https://github.com/cantino/reckon/pull/78) ([benprew](https://github.com/benprew))
|
|
138
206
|
- Better ISO 8601 dates support [\#49](https://github.com/cantino/reckon/pull/49) ([vzctl](https://github.com/vzctl))
|
|
139
207
|
- Unattended mode and custom tokens support [\#47](https://github.com/cantino/reckon/pull/47) ([vzctl](https://github.com/vzctl))
|
|
140
208
|
- \[RFC\] Implement issue \#40: Tab completion [\#46](https://github.com/cantino/reckon/pull/46) ([BlackEdder](https://github.com/BlackEdder))
|
|
@@ -148,6 +216,7 @@
|
|
|
148
216
|
|
|
149
217
|
- Fix --encoding option [\#41](https://github.com/cantino/reckon/pull/41) ([mamciek](https://github.com/mamciek))
|
|
150
218
|
- Bumped version number [\#37](https://github.com/cantino/reckon/pull/37) ([BlackEdder](https://github.com/BlackEdder))
|
|
219
|
+
- Ing csv [\#30](https://github.com/cantino/reckon/pull/30) ([BlackEdder](https://github.com/BlackEdder))
|
|
151
220
|
|
|
152
221
|
## [v0.3.9](https://github.com/cantino/reckon/tree/v0.3.9) (2014-02-20)
|
|
153
222
|
|
|
@@ -164,15 +233,12 @@
|
|
|
164
233
|
- Date format [\#35](https://github.com/cantino/reckon/pull/35) ([BlackEdder](https://github.com/BlackEdder))
|
|
165
234
|
- Added example from a french bank [\#34](https://github.com/cantino/reckon/pull/34) ([BlackEdder](https://github.com/BlackEdder))
|
|
166
235
|
- Austrian example [\#33](https://github.com/cantino/reckon/pull/33) ([BlackEdder](https://github.com/BlackEdder))
|
|
167
|
-
- Ing csv [\#30](https://github.com/cantino/reckon/pull/30) ([BlackEdder](https://github.com/BlackEdder))
|
|
168
236
|
- Further improvements in nationwide csv handling [\#29](https://github.com/cantino/reckon/pull/29) ([BlackEdder](https://github.com/BlackEdder))
|
|
169
237
|
- Refactor: Add money class [\#28](https://github.com/cantino/reckon/pull/28) ([BlackEdder](https://github.com/BlackEdder))
|
|
170
238
|
- Initial split of CSVparser from class App [\#27](https://github.com/cantino/reckon/pull/27) ([BlackEdder](https://github.com/BlackEdder))
|
|
171
239
|
- Updated version of pull request 24: Allow for other currency symbols while calculating money\_score [\#26](https://github.com/cantino/reckon/pull/26) ([BlackEdder](https://github.com/BlackEdder))
|
|
172
240
|
- Change double column detection [\#23](https://github.com/cantino/reckon/pull/23) ([BlackEdder](https://github.com/BlackEdder))
|
|
173
|
-
- Added optional argument to contains\_header to skip multiple header lines [\#22](https://github.com/cantino/reckon/pull/22) ([BlackEdder](https://github.com/BlackEdder))
|
|
174
241
|
- Add a Bitdeli Badge to README [\#20](https://github.com/cantino/reckon/pull/20) ([bitdeli-chef](https://github.com/bitdeli-chef))
|
|
175
|
-
- Update README to show latest usage info [\#19](https://github.com/cantino/reckon/pull/19) ([purcell](https://github.com/purcell))
|
|
176
242
|
|
|
177
243
|
## [v0.3.8](https://github.com/cantino/reckon/tree/v0.3.8) (2013-07-03)
|
|
178
244
|
|
|
@@ -189,6 +255,7 @@
|
|
|
189
255
|
|
|
190
256
|
**Merged pull requests:**
|
|
191
257
|
|
|
258
|
+
- Update README to show latest usage info [\#19](https://github.com/cantino/reckon/pull/19) ([purcell](https://github.com/purcell))
|
|
192
259
|
- add support for spanish dates dd/mm/yyyy closes \#13 [\#14](https://github.com/cantino/reckon/pull/14) ([mauromorales](https://github.com/mauromorales))
|
|
193
260
|
- fix issue showing true when parsing the currency option related to \#7 [\#12](https://github.com/cantino/reckon/pull/12) ([mauromorales](https://github.com/mauromorales))
|
|
194
261
|
|
|
@@ -198,6 +265,8 @@
|
|
|
198
265
|
|
|
199
266
|
**Merged pull requests:**
|
|
200
267
|
|
|
268
|
+
- Added optional argument to contains\_header to skip multiple header lines [\#22](https://github.com/cantino/reckon/pull/22) ([BlackEdder](https://github.com/BlackEdder))
|
|
269
|
+
- Updated the sources to allow for custom curreny [\#11](https://github.com/cantino/reckon/pull/11) ([ghost](https://github.com/ghost))
|
|
201
270
|
- Add --account option on the commandline [\#10](https://github.com/cantino/reckon/pull/10) ([copiousfreetime](https://github.com/copiousfreetime))
|
|
202
271
|
|
|
203
272
|
## [v0.3.6](https://github.com/cantino/reckon/tree/v0.3.6) (2013-04-30)
|
|
@@ -231,7 +300,6 @@
|
|
|
231
300
|
|
|
232
301
|
**Merged pull requests:**
|
|
233
302
|
|
|
234
|
-
- Updated the sources to allow for custom curreny [\#11](https://github.com/cantino/reckon/pull/11) ([ghost](https://github.com/ghost))
|
|
235
303
|
- adds support for Nordea csv files [\#1](https://github.com/cantino/reckon/pull/1) ([x2q](https://github.com/x2q))
|
|
236
304
|
|
|
237
305
|
## [v0.3.3](https://github.com/cantino/reckon/tree/v0.3.3) (2013-01-13)
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Reckon
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
|
|
5
5
|
Reckon automagically converts CSV files for use with the command-line accounting tool [Ledger](http://www.ledger-cli.org/). It also helps you to select the correct accounts associated with the CSV data using Bayesian machine learning.
|
|
6
6
|
|
|
@@ -34,35 +34,42 @@ Learn more:
|
|
|
34
34
|
|
|
35
35
|
Usage: Reckon.rb [options]
|
|
36
36
|
|
|
37
|
-
|
|
38
37
|
-f, --file FILE The CSV file to parse
|
|
39
|
-
-a, --account
|
|
38
|
+
-a, --account NAME The Ledger Account this file is for
|
|
40
39
|
-v, --[no-]verbose Run verbosely
|
|
41
40
|
-i, --inverse Use the negative of each amount
|
|
42
41
|
-p, --print-table Print out the parsed CSV in table form
|
|
43
42
|
-o, --output-file FILE The ledger file to append to
|
|
44
43
|
-l, --learn-from FILE An existing ledger file to learn accounts from
|
|
45
44
|
--ignore-columns 1,2,5
|
|
46
|
-
Columns to ignore
|
|
45
|
+
Columns to ignore, starts from 1
|
|
46
|
+
--money-column 2
|
|
47
|
+
Column number of the money column, starts from 1
|
|
48
|
+
--raw-money
|
|
49
|
+
Don't format money column (for stocks)
|
|
50
|
+
--date-column 3
|
|
51
|
+
Column number of the date column, starts from 1
|
|
47
52
|
--contains-header [N]
|
|
48
|
-
|
|
53
|
+
Skip N header rows - default 1
|
|
49
54
|
--csv-separator ','
|
|
50
|
-
|
|
55
|
+
CSV separator (default ',')
|
|
51
56
|
--comma-separates-cents
|
|
52
|
-
Use comma
|
|
57
|
+
Use comma to separate cents ($100,50 vs. $100.50)
|
|
53
58
|
--encoding 'UTF-8'
|
|
54
|
-
Specify an encoding for the CSV file
|
|
55
|
-
-c, --currency '$' Currency symbol to use
|
|
59
|
+
Specify an encoding for the CSV file
|
|
60
|
+
-c, --currency '$' Currency symbol to use - default $ (ex £, EUR)
|
|
56
61
|
--date-format '%d/%m/%Y'
|
|
57
62
|
Force the date format (see Ruby DateTime strftime)
|
|
58
|
-
-u, --unattended Don't ask questions and guess all the accounts automatically.
|
|
63
|
+
-u, --unattended Don't ask questions and guess all the accounts automatically. Use with --learn-from or --account-tokens options.
|
|
59
64
|
-t, --account-tokens FILE YAML file with manually-assigned tokens for each account (see README)
|
|
60
|
-
--default-into-account
|
|
65
|
+
--default-into-account NAME
|
|
61
66
|
Default into account
|
|
62
|
-
--default-outof-account
|
|
67
|
+
--default-outof-account NAME
|
|
63
68
|
Default 'out of' account
|
|
69
|
+
--fail-on-unknown-account
|
|
70
|
+
Fail on unmatched transactions.
|
|
64
71
|
--suffixed
|
|
65
|
-
|
|
72
|
+
Append currency symbol as a suffix.
|
|
66
73
|
-h, --help Show this message
|
|
67
74
|
--version Show version
|
|
68
75
|
|
|
@@ -77,6 +84,20 @@ To guess the accounts reckon can use an existing ledger file or a token file wit
|
|
|
77
84
|
|
|
78
85
|
`reckon --unattended --account-tokens tokens.yaml -f bank.csv -o ledger.dat`
|
|
79
86
|
|
|
87
|
+
In unattended mode, you can use STDIN to read your csv data, by specifying `-` as the argument to `-f`.
|
|
88
|
+
|
|
89
|
+
`csv_file_generator | reckon --unattended -l 2010.dat -o ledger.dat -f -`
|
|
90
|
+
|
|
91
|
+
### Account Tokens
|
|
92
|
+
|
|
93
|
+
The account tokens file provides a way to teach reckon about what tokens are associated with an account. As an example, this `tokens.yaml` file:
|
|
94
|
+
|
|
95
|
+
Expenses:
|
|
96
|
+
Bank:
|
|
97
|
+
- 'ING Direct Deposit'
|
|
98
|
+
|
|
99
|
+
Would tokenize to 'ING', 'Direct' and 'Deposit'. The matcher would then suggest matches to transactions that included those tokens. (ex 'Chase Direct Deposit')
|
|
100
|
+
|
|
80
101
|
Here's an example of `tokens.yaml`:
|
|
81
102
|
|
|
82
103
|
```
|
|
@@ -96,21 +117,61 @@ Expenses:
|
|
|
96
117
|
- '4433221100' # Your own account number
|
|
97
118
|
```
|
|
98
119
|
|
|
99
|
-
|
|
100
|
-
|
|
120
|
+
Reckon will use `Income:Unknown` or `Expenses:Unknown` if it can't match a transaction to an account.
|
|
121
|
+
|
|
122
|
+
You can override these names with the `--default_outof_account` and `--default_into_account` options.
|
|
123
|
+
|
|
124
|
+
### Substring Match
|
|
125
|
+
|
|
126
|
+
If, in the above example, you'd prefer to match any transaction that contains the string 'ING Direct Deposit' you have to use a regex:
|
|
127
|
+
|
|
128
|
+
Expenses:
|
|
129
|
+
Bank:
|
|
130
|
+
- /ING Direct Deposit/
|
|
131
|
+
|
|
132
|
+
## Contributing
|
|
133
|
+
|
|
134
|
+
We encourage you to contribute to Reckon! Here is some information to help you.
|
|
135
|
+
|
|
136
|
+
### Patches/Pull Requests Process
|
|
101
137
|
|
|
102
|
-
|
|
138
|
+
1. Fork the project.
|
|
139
|
+
2. Make your feature addition or bug fix.
|
|
140
|
+
3. Add tests for it. This is important so I don't break it in a future version unintentionally.
|
|
141
|
+
4. Commit, do not mess with rakefile, version, or history.
|
|
142
|
+
- (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
143
|
+
5. Send me a pull request. Bonus points for topic branches.
|
|
144
|
+
|
|
145
|
+
### Integration Tests
|
|
146
|
+
|
|
147
|
+
Reckon has integration test located in `spec/integration`. These are integration and regression tests for reckon.
|
|
148
|
+
|
|
149
|
+
Run all the tests:
|
|
150
|
+
|
|
151
|
+
./spec/integration/test.sh
|
|
152
|
+
|
|
153
|
+
Run a single test
|
|
154
|
+
|
|
155
|
+
./spec/integration/test.sh chase/account_tokens_and_regex
|
|
156
|
+
|
|
157
|
+
#### Add a new integration test
|
|
158
|
+
|
|
159
|
+
Each test has it's own directory, which you can add any files you want, but the following files are required:
|
|
160
|
+
|
|
161
|
+
- `test_args` - arguments to add to the reckon command to test against, can specify `--unattended`, `-f input.csv`, etc
|
|
162
|
+
- `output.ledger` - the expected ledger file output
|
|
163
|
+
|
|
164
|
+
If the result of running reckon with `test_args` does not match `output.ledger`, then the test fails.
|
|
165
|
+
|
|
166
|
+
Most tests will specify `--unattended`, otherwise reckon prompts for keyboard input.
|
|
167
|
+
|
|
168
|
+
The convention is to use `input.csv` as the input file, and `tokens.yml` as the tokens file, but it is not required.
|
|
103
169
|
|
|
104
|
-
* Fork the project.
|
|
105
|
-
* Make your feature addition or bug fix.
|
|
106
|
-
* Add tests for it. This is important so I don't break it in a
|
|
107
|
-
future version unintentionally.
|
|
108
|
-
* Commit, do not mess with rakefile, version, or history.
|
|
109
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
|
110
|
-
* Send me a pull request. Bonus points for topic branches.
|
|
111
170
|
|
|
112
171
|
## Copyright
|
|
113
172
|
|
|
114
|
-
Copyright (c) 2013 Andrew Cantino. See LICENSE for details.
|
|
173
|
+
Copyright (c) 2013 Andrew Cantino (@cantino). See LICENSE for details.
|
|
115
174
|
|
|
116
175
|
Thanks to @BlackEdder for many contributions!
|
|
176
|
+
|
|
177
|
+
Currently maintained by @benprew. Thank you!
|
data/Rakefile
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require "bundler/gem_tasks"
|
|
2
4
|
require 'rspec/core/rake_task'
|
|
5
|
+
require 'English'
|
|
3
6
|
|
|
4
7
|
RSpec::Core::RakeTask.new(:spec)
|
|
5
8
|
|
|
6
|
-
task :
|
|
9
|
+
task default: :spec
|
|
10
|
+
|
|
11
|
+
task :test_all do
|
|
12
|
+
puts "#{`ledger --version |head -n1`}"
|
|
13
|
+
puts "Running unit tests"
|
|
14
|
+
Rake::Task["spec"].invoke
|
|
15
|
+
puts "Running integration tests"
|
|
16
|
+
Rake::Task["integration_tests"].invoke
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
task :integration_tests do
|
|
20
|
+
cmd = 'prove -v ./spec/integration/test.sh'
|
|
21
|
+
raise 'Integration tests failed' unless system(cmd)
|
|
22
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
VERSION=$1
|
|
6
|
+
|
|
7
|
+
echo "Install github_changelog_generator"
|
|
8
|
+
# gem install --user github_changelog_generator
|
|
9
|
+
|
|
10
|
+
echo "Update 'lib/reckon/version.rb'"
|
|
11
|
+
echo -e "module Reckon\n VERSION=\"$VERSION\"\nend" > lib/reckon/version.rb
|
|
12
|
+
echo "Run `bundle install` to build updated Gemfile.lock"
|
|
13
|
+
bundle install
|
|
14
|
+
echo "Run changelog generator (requires $TOKEN to be your github token)"
|
|
15
|
+
github_changelog_generator -u cantino -p reckon -t $TOKEN --future-release v$VERSION
|
|
16
|
+
echo "Commit changes"
|
|
17
|
+
git add CHANGELOG.md lib/reckon/version.rb Gemfile.lock
|
|
18
|
+
git commit -m "Release $VERSION"
|
|
19
|
+
echo "Tag release"
|
|
20
|
+
git tag v$VERSION
|
|
21
|
+
echo "Build new gem"
|
|
22
|
+
gem build reckon.gemspec
|
|
23
|
+
echo "Push changes and tags"
|
|
24
|
+
echo "git push && git push --tags"
|
|
25
|
+
echo "Push new gem"
|
|
26
|
+
echo "gem push reckon-$VERSION.gem"
|
data/bin/reckon
CHANGED
|
@@ -3,11 +3,19 @@
|
|
|
3
3
|
require 'rubygems'
|
|
4
4
|
require 'reckon'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
begin
|
|
7
|
+
options = Reckon::Options.parse
|
|
8
|
+
rescue RuntimeError => e
|
|
9
|
+
puts("ERROR: #{e}")
|
|
10
|
+
exit(1)
|
|
11
|
+
end
|
|
7
12
|
reckon = Reckon::App.new(options)
|
|
8
13
|
|
|
9
14
|
if options[:print_table]
|
|
10
15
|
reckon.output_table
|
|
16
|
+
if options[:table_output_file]
|
|
17
|
+
File.open(options[:table_output_file], 'w') { |fh| reckon.output_table fh }
|
|
18
|
+
end
|
|
11
19
|
exit
|
|
12
20
|
end
|
|
13
21
|
|