qiflib 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/html/Qiflib/Date.html +27 -23
- data/html/Qiflib/Money.html +23 -19
- data/html/Qiflib/Transaction.html +139 -135
- data/html/Qiflib/Util.html +231 -203
- data/html/Qiflib.html +53 -38
- data/html/README_rdoc.html +6 -3
- data/html/index.html +6 -3
- data/html/lib/qiflib_constants_rb.html +7 -2
- data/html/lib/qiflib_date_rb.html +1 -1
- data/html/lib/qiflib_money_rb.html +1 -1
- data/html/lib/qiflib_rb.html +1 -1
- data/html/lib/qiflib_transaction_rb.html +1 -1
- data/html/lib/qiflib_util_rb.html +1 -1
- data/lib/qiflib.rb +1 -1
- data/lib/qiflib_constants.rb +8 -1
- data/lib/qiflib_date.rb +3 -6
- data/lib/qiflib_money.rb +2 -0
- data/lib/qiflib_util.rb +19 -0
- metadata +3 -3
data/html/Qiflib.html
CHANGED
@@ -158,7 +158,12 @@
|
|
158
158
|
<h1 class="module">Qiflib</h1>
|
159
159
|
|
160
160
|
<div id="description">
|
161
|
-
|
161
|
+
<p>
|
162
|
+
This file, and <a href="Qiflib.html">Qiflib</a> module, define constant
|
163
|
+
values used in this library. This include the lists of field names within
|
164
|
+
the csv and delimited files.
|
165
|
+
</p>
|
166
|
+
|
162
167
|
</div>
|
163
168
|
|
164
169
|
<!-- Constants -->
|
@@ -177,6 +182,16 @@
|
|
177
182
|
<dd class="description"></dd>
|
178
183
|
|
179
184
|
|
185
|
+
<dt><a name="AUTHOR">AUTHOR</a></dt>
|
186
|
+
|
187
|
+
<dd class="description"></dd>
|
188
|
+
|
189
|
+
|
190
|
+
<dt><a name="EMAIL">EMAIL</a></dt>
|
191
|
+
|
192
|
+
<dd class="description"></dd>
|
193
|
+
|
194
|
+
|
180
195
|
<dt><a name="SOURCE_QUICKEN">SOURCE_QUICKEN</a></dt>
|
181
196
|
|
182
197
|
<dd class="description"></dd>
|
@@ -220,10 +235,10 @@
|
|
220
235
|
<div class="method-source-code"
|
221
236
|
id="csv-category-field-names-source">
|
222
237
|
<pre>
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
238
|
+
<span class="ruby-comment cmt"># File lib/qiflib_constants.rb, line 14</span>
|
239
|
+
14: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">csv_category_field_names</span>
|
240
|
+
15: <span class="ruby-node">%( id name )</span>
|
241
|
+
16: <span class="ruby-keyword kw">end</span></pre>
|
227
242
|
</div>
|
228
243
|
|
229
244
|
</div>
|
@@ -254,39 +269,39 @@
|
|
254
269
|
<div class="method-source-code"
|
255
270
|
id="csv-transaction-field-names-source">
|
256
271
|
<pre>
|
257
|
-
<span class="ruby-comment cmt"># File lib/qiflib_constants.rb, line
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
272
|
+
<span class="ruby-comment cmt"># File lib/qiflib_constants.rb, line 18</span>
|
273
|
+
18: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">csv_transaction_field_names</span>
|
274
|
+
19: <span class="ruby-node">%(
|
275
|
+
20: id
|
276
|
+
21: acct_owner
|
277
|
+
22: acct_name
|
278
|
+
23: acct_type
|
279
|
+
24: date
|
280
|
+
25: amount
|
281
|
+
26: number
|
282
|
+
27: ibank_n
|
283
|
+
28: cleared
|
284
|
+
29: payee
|
285
|
+
30: category
|
286
|
+
31: memo
|
287
|
+
32: split1_amount
|
288
|
+
33: split1_category
|
289
|
+
34: split1_memo
|
290
|
+
35: split2_amount
|
291
|
+
36: split2_category
|
292
|
+
37: split2_memo
|
293
|
+
38: split3_amount
|
294
|
+
39: split3_category
|
295
|
+
40: split3_memo
|
296
|
+
41: address1
|
297
|
+
42: address2
|
298
|
+
43: address3
|
299
|
+
44: address4
|
300
|
+
45: address5
|
301
|
+
46: address6
|
302
|
+
47: eol_ind
|
303
|
+
48: )</span>
|
304
|
+
49: <span class="ruby-keyword kw">end</span></pre>
|
290
305
|
</div>
|
291
306
|
|
292
307
|
</div>
|
data/html/README_rdoc.html
CHANGED
@@ -87,7 +87,8 @@ A ruby library for reading and parsing qif files.
|
|
87
87
|
</p>
|
88
88
|
<p>
|
89
89
|
Transaction parsing is supported, including address fields, and up to three
|
90
|
-
“splits” per transaction.
|
90
|
+
“splits” per transaction. See the DDL, below, for the list of
|
91
|
+
fields for each transaction.
|
91
92
|
</p>
|
92
93
|
<p>
|
93
94
|
Category-name parsing is also supported.
|
@@ -164,7 +165,7 @@ transactions into a sqlite3 database.
|
|
164
165
|
|
165
166
|
... write sh_lines to a file; chmod 744; run it.
|
166
167
|
</pre>
|
167
|
-
<h2>Generated DDL
|
168
|
+
<h2>Generated DDL</h2>
|
168
169
|
<pre>
|
169
170
|
# DDL file for sqlite3
|
170
171
|
|
@@ -211,7 +212,9 @@ transactions into a sqlite3 database.
|
|
211
212
|
|
212
213
|
.import qiflib_transactions.txt transactions
|
213
214
|
.import qiflib_categories.txt categories
|
214
|
-
|
215
|
+
</pre>
|
216
|
+
<h2>Generated shell script </h2>
|
217
|
+
<pre>
|
215
218
|
# bash-shell script
|
216
219
|
|
217
220
|
#!/bin/bash
|
data/html/index.html
CHANGED
@@ -29,7 +29,8 @@ A ruby library for reading and parsing qif files.
|
|
29
29
|
</p>
|
30
30
|
<p>
|
31
31
|
Transaction parsing is supported, including address fields, and up to three
|
32
|
-
“splits” per transaction.
|
32
|
+
“splits” per transaction. See the DDL, below, for the list of
|
33
|
+
fields for each transaction.
|
33
34
|
</p>
|
34
35
|
<p>
|
35
36
|
Category-name parsing is also supported.
|
@@ -106,7 +107,7 @@ transactions into a sqlite3 database.
|
|
106
107
|
|
107
108
|
... write sh_lines to a file; chmod 744; run it.
|
108
109
|
</pre>
|
109
|
-
<h2>Generated DDL
|
110
|
+
<h2>Generated DDL</h2>
|
110
111
|
<pre>
|
111
112
|
# DDL file for sqlite3
|
112
113
|
|
@@ -153,7 +154,9 @@ transactions into a sqlite3 database.
|
|
153
154
|
|
154
155
|
.import qiflib_transactions.txt transactions
|
155
156
|
.import qiflib_categories.txt categories
|
156
|
-
|
157
|
+
</pre>
|
158
|
+
<h2>Generated shell script </h2>
|
159
|
+
<pre>
|
157
160
|
# bash-shell script
|
158
161
|
|
159
162
|
#!/bin/bash
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<div id="metadata">
|
25
25
|
<dl>
|
26
26
|
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">2012-04-08
|
27
|
+
<dd class="modified-date">2012-04-08 18:06:47 -0400</dd>
|
28
28
|
|
29
29
|
|
30
30
|
<dt class="requires">Requires</dt>
|
@@ -43,7 +43,12 @@
|
|
43
43
|
|
44
44
|
<div class="description">
|
45
45
|
<h2>Description</h2>
|
46
|
-
|
46
|
+
<p>
|
47
|
+
This file, and <a href="../Qiflib.html">Qiflib</a> module, define constant
|
48
|
+
values used in this library. This include the lists of field names within
|
49
|
+
the csv and delimited files.
|
50
|
+
</p>
|
51
|
+
|
47
52
|
</div>
|
48
53
|
|
49
54
|
</div>
|
data/html/lib/qiflib_rb.html
CHANGED
data/lib/qiflib.rb
CHANGED
data/lib/qiflib_constants.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
|
+
|
2
|
+
# This file, and Qiflib module, define constant values used in this library.
|
3
|
+
# This include the lists of field names within the csv and delimited files.
|
4
|
+
|
1
5
|
module Qiflib
|
2
|
-
|
6
|
+
|
7
|
+
VERSION = '0.1.0'
|
3
8
|
DATE = '2012-04-08'
|
9
|
+
AUTHOR = 'Chris Joakim'
|
10
|
+
EMAIL = 'cjoakim@bellsouth.net'
|
4
11
|
SOURCE_QUICKEN = 'quicken'
|
5
12
|
SOURCE_IBANK = 'ibank'
|
6
13
|
|
data/lib/qiflib_date.rb
CHANGED
@@ -1,12 +1,9 @@
|
|
1
|
-
=begin rdoc
|
2
|
-
|
3
|
-
Instances of this class represent a date from within a qif file,
|
4
|
-
such as 'D5/24/94'.
|
5
|
-
|
6
|
-
=end
|
7
1
|
|
8
2
|
module Qiflib
|
9
3
|
|
4
|
+
# Instances of this class represent a date from within a qif file,
|
5
|
+
# such as 'D5/24/94'.
|
6
|
+
|
10
7
|
class Date
|
11
8
|
|
12
9
|
attr_accessor :string_value, :ccyymmdd, :year, :year_mm, :yy, :mm, :dd
|
data/lib/qiflib_money.rb
CHANGED
data/lib/qiflib_util.rb
CHANGED
@@ -46,6 +46,9 @@ module Qiflib
|
|
46
46
|
csv_lines
|
47
47
|
end
|
48
48
|
|
49
|
+
# Return lines in ^-delimited format which contain the list of categories
|
50
|
+
# within the given Array of filenames.
|
51
|
+
|
49
52
|
def self.catetory_names_to_delim(files_list)
|
50
53
|
delim_lines, csv_lines = [], catetory_names_to_csv(files_list)
|
51
54
|
csv_lines.each_with_index { | csv_line, idx |
|
@@ -61,6 +64,11 @@ module Qiflib
|
|
61
64
|
}
|
62
65
|
delim_lines
|
63
66
|
end
|
67
|
+
|
68
|
+
# Return lines in CSV format which contain the list of transactions
|
69
|
+
# within the given input_list Array. Each Hash within the input_list
|
70
|
+
# should contain keys :owner, :filename, and :source. Specify either
|
71
|
+
# the value Qiflib::SOURCE_IBANK or Qiflib::SOURCE_QUICKEN for :source.
|
64
72
|
|
65
73
|
def self.transactions_to_csv(input_list)
|
66
74
|
transactions, csv_lines = [], []
|
@@ -78,6 +86,11 @@ module Qiflib
|
|
78
86
|
end
|
79
87
|
csv_lines
|
80
88
|
end
|
89
|
+
|
90
|
+
# Return lines in ^-delimited format which contain the list of transactions
|
91
|
+
# within the given input_list Array. Each Hash within the input_list
|
92
|
+
# should contain keys :owner, :filename, and :source. Specify either
|
93
|
+
# the value Qiflib::SOURCE_IBANK or Qiflib::SOURCE_QUICKEN for :source.
|
81
94
|
|
82
95
|
def self.transactions_to_delim(input_list)
|
83
96
|
delim_lines, csv_lines = [], transactions_to_csv(input_list)
|
@@ -95,6 +108,9 @@ module Qiflib
|
|
95
108
|
delim_lines
|
96
109
|
end
|
97
110
|
|
111
|
+
# Return the lines of DDL for a sqlite3 database, with 'categories' and
|
112
|
+
# 'transactions' tables. The DDL will also import the ^-delimited files.
|
113
|
+
|
98
114
|
def self.generate_sqlite_ddl
|
99
115
|
lines = []
|
100
116
|
lines << ''
|
@@ -144,6 +160,9 @@ module Qiflib
|
|
144
160
|
lines << ''
|
145
161
|
lines
|
146
162
|
end
|
163
|
+
|
164
|
+
# Return the lines of bash-shell script to load the sqlite3 database via
|
165
|
+
# the DDL generated in method 'generate_sqlite_ddl'.
|
147
166
|
|
148
167
|
def self.generate_sqlite_load_script(db_name='qiflib.db', ddl_name='qiflib.ddl')
|
149
168
|
lines = []
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qiflib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-04-08 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70149979579340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 2.9.0
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70149979579340
|
25
25
|
description: A ruby library for qif file processing.
|
26
26
|
email: cjoakim@bellsouth.net
|
27
27
|
executables: []
|