ynab_convert 1.0.5 → 1.0.8
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 +3 -0
- data/Gemfile.lock +1 -1
- data/lib/ynab_convert/processor/ubs_chequing.rb +38 -12
- data/lib/ynab_convert/version.rb +1 -1
- data/ynab_convert.gemspec +5 -0
- metadata +6 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '01824e596b5db266fa8e21210a6ec3bb6742f2ead99a38a9b3ad94cb05f2c8f2'
|
|
4
|
+
data.tar.gz: d85fe2a7025389684640282aec1ea75ec7d933aac9c3940b38839bd156c9aa12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2215ad54cc79274403b940459c50b287789f3c4b7df632187381d97bb99c55ba4f96df372e8bfb2087fd20eef70d0e47d2a8fd1b5d4ecc2d008826230aa74a00
|
|
7
|
+
data.tar.gz: a1486eb5cfba186a661e8f0458c5b78bf985093812e02f551051047b8fd45ca58266cc4b18622b5d00a3e5e17a44286cd366cf01493aab68f24f8bb9eda031a7
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -59,22 +59,48 @@ module Processor
|
|
|
59
59
|
end
|
|
60
60
|
|
|
61
61
|
def transaction_payee(row)
|
|
62
|
+
raw_payee_line = [
|
|
63
|
+
row[headers[:payee_line_2]],
|
|
64
|
+
row[headers[:payee_line_3]]
|
|
65
|
+
]
|
|
66
|
+
|
|
62
67
|
# Transaction description is spread over 3 columns.
|
|
68
|
+
# There are two types of entries:
|
|
69
|
+
# 1. only the first column contains data
|
|
70
|
+
# 2. all three columns contain data, most of it junk
|
|
71
|
+
#
|
|
72
|
+
# Cleaning them up means dropping the first column if there is anything
|
|
73
|
+
# in the other columns;
|
|
74
|
+
# removing the CARD 00000000-0 0000 at the beginning of debit card
|
|
75
|
+
# payment entries;
|
|
76
|
+
# removing the rest of the junk appended after the worthwhile data (see
|
|
77
|
+
# below for details on that)
|
|
78
|
+
if row[headers[:payee_line_2]].nil?
|
|
79
|
+
# Make it an Array, for consistency
|
|
80
|
+
raw_payee_line = [row[headers[:payee_line_1]]]
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
concat_payee_line = raw_payee_line.join(' ')
|
|
84
|
+
|
|
63
85
|
# Moreover, UBS thought wise to append a bunch of junk information after
|
|
64
86
|
# the transaction details within the third description field. *Most* of
|
|
65
87
|
# this junk starts after the meaningful data and starts with ", OF",
|
|
66
|
-
# ", ON", ", ESR", two digits then five groups of five digits
|
|
67
|
-
# so we discard it; YNAB4 being unable to automatically
|
|
68
|
-
# transactions at the same store/payee because the payee
|
|
69
|
-
# different (thanks to the variable nature of the appended
|
|
70
|
-
#
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
88
|
+
# ", ON", ", ESR", ", QRR", two digits then five groups of five digits
|
|
89
|
+
# then ", TN" so we discard it; YNAB4 being unable to automatically
|
|
90
|
+
# categorize new transactions at the same store/payee because the payee
|
|
91
|
+
# always looks different (thanks to the variable nature of the appended
|
|
92
|
+
# junk).
|
|
93
|
+
# See `spec/fixtures/ubs_chequing/statement.csv` L2 and L18--22
|
|
94
|
+
|
|
95
|
+
# rubocop:disable Metrics/LineLength
|
|
96
|
+
junk_desc_regex = /,? (O[FN]|ESR|QRR|\d{2} \d{5} \d{5} \d{5} \d{5} \d{5}, TN).*/
|
|
97
|
+
# rubocop:enable Metrics/LineLength
|
|
98
|
+
|
|
99
|
+
# Of course, it wouldn't be complete with more junk information at the
|
|
100
|
+
# beginning of *some* lines (debit card payments)
|
|
101
|
+
debit_card_junk_regex = /CARD \d{8}\-\d \d{4} /
|
|
102
|
+
|
|
103
|
+
concat_payee_line.sub(junk_desc_regex, '').sub(debit_card_junk_regex, '')
|
|
78
104
|
end
|
|
79
105
|
|
|
80
106
|
def register_custom_converters
|
data/lib/ynab_convert/version.rb
CHANGED
data/ynab_convert.gemspec
CHANGED
|
@@ -13,6 +13,11 @@ Gem::Specification.new do |spec|
|
|
|
13
13
|
spec.summary = 'Convert online banking CSV files to YNAB 4 format.'
|
|
14
14
|
spec.homepage = 'https://github.com/coaxial/ynab_convert'
|
|
15
15
|
spec.license = 'MIT'
|
|
16
|
+
spec.description = <<~DESC
|
|
17
|
+
Utility to convert CSV statements into the YNAB4 format for easier
|
|
18
|
+
transation import. Supports several banks and can easily be extended to
|
|
19
|
+
add more.
|
|
20
|
+
DESC
|
|
16
21
|
|
|
17
22
|
spec.required_ruby_version = '~> 2.6'
|
|
18
23
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ynab_convert
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- coaxial
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-03-
|
|
11
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -192,7 +192,10 @@ dependencies:
|
|
|
192
192
|
- - ">="
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
194
|
version: '0'
|
|
195
|
-
description:
|
|
195
|
+
description: |
|
|
196
|
+
Utility to convert CSV statements into the YNAB4 format for easier
|
|
197
|
+
transation import. Supports several banks and can easily be extended to
|
|
198
|
+
add more.
|
|
196
199
|
email:
|
|
197
200
|
- hi@64b.it
|
|
198
201
|
executables:
|