qiflib 0.2.0 → 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 +7 -0
- data/README.rdoc +37 -37
- data/html/Qiflib/Category.html +243 -262
- data/html/Qiflib/Date.html +255 -294
- data/html/Qiflib/Money.html +213 -226
- data/html/Qiflib/Transaction.html +517 -568
- data/html/Qiflib/Util.html +322 -333
- data/html/Qiflib.html +197 -234
- data/html/README_rdoc.html +144 -130
- data/html/index.html +125 -155
- data/html/rdoc.css +170 -338
- data/html/table_of_contents.html +130 -0
- data/lib/qiflib_constants.rb +6 -7
- data/lib/qiflib_util.rb +35 -36
- metadata +15 -25
- data/html/lib/qiflib_category_rb.html +0 -52
- data/html/lib/qiflib_constants_rb.html +0 -56
- data/html/lib/qiflib_date_rb.html +0 -52
- data/html/lib/qiflib_money_rb.html +0 -52
- data/html/lib/qiflib_rb.html +0 -68
- data/html/lib/qiflib_transaction_rb.html +0 -52
- data/html/lib/qiflib_util_rb.html +0 -52
data/html/index.html
CHANGED
@@ -1,30 +1,85 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
1
|
+
<!DOCTYPE html>
|
4
2
|
|
5
|
-
<html
|
3
|
+
<html>
|
6
4
|
<head>
|
7
|
-
|
5
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
8
6
|
|
9
|
-
|
7
|
+
<title>qiflib</title>
|
10
8
|
|
11
|
-
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
12
10
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<script src="js/darkfish.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
17
14
|
|
18
|
-
|
19
|
-
<
|
15
|
+
<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
|
16
|
+
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
|
17
|
+
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
|
18
|
+
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
|
19
|
+
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
|
20
|
+
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
|
20
21
|
|
22
|
+
|
23
|
+
<body>
|
24
|
+
<nav id="metadata">
|
25
|
+
<nav id="home-section" class="section">
|
26
|
+
<h3 class="section-header">
|
27
|
+
<a href="./index.html">Home</a>
|
28
|
+
<a href="./table_of_contents.html#classes">Classes</a>
|
29
|
+
<a href="./table_of_contents.html#methods">Methods</a>
|
30
|
+
</h3>
|
31
|
+
</nav>
|
32
|
+
|
33
|
+
|
34
|
+
<nav id="search-section" class="section project-section" class="initially-hidden">
|
35
|
+
<form action="#" method="get" accept-charset="utf-8">
|
36
|
+
<h3 class="section-header">
|
37
|
+
<input type="text" name="search" placeholder="Search" id="search-field"
|
38
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
39
|
+
</h3>
|
40
|
+
</form>
|
41
|
+
|
42
|
+
<ul id="search-results" class="initially-hidden"></ul>
|
43
|
+
</nav>
|
44
|
+
|
45
|
+
|
46
|
+
<div id="project-metadata">
|
47
|
+
<nav id="fileindex-section" class="section project-section">
|
48
|
+
<h3 class="section-header">Pages</h3>
|
49
|
+
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
21
53
|
|
22
|
-
|
54
|
+
</ul>
|
55
|
+
</nav>
|
56
|
+
|
57
|
+
<nav id="classindex-section" class="section project-section">
|
58
|
+
<h3 class="section-header">Class and Module Index</h3>
|
23
59
|
|
60
|
+
<ul class="link-list">
|
61
|
+
|
62
|
+
<li><a href="./Qiflib.html">Qiflib</a>
|
63
|
+
|
64
|
+
<li><a href="./Qiflib/Category.html">Qiflib::Category</a>
|
65
|
+
|
66
|
+
<li><a href="./Qiflib/Date.html">Qiflib::Date</a>
|
24
67
|
|
25
|
-
|
26
|
-
|
27
|
-
<
|
68
|
+
<li><a href="./Qiflib/Money.html">Qiflib::Money</a>
|
69
|
+
|
70
|
+
<li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a>
|
71
|
+
|
72
|
+
<li><a href="./Qiflib/Util.html">Qiflib::Util</a>
|
73
|
+
|
74
|
+
</ul>
|
75
|
+
</nav>
|
76
|
+
|
77
|
+
</div>
|
78
|
+
</nav>
|
79
|
+
|
80
|
+
<div id="documentation" class="description">
|
81
|
+
|
82
|
+
<h2 id="label-Qiflib"><a href="Qiflib.html">Qiflib</a><span><a href="#label-Qiflib">¶</a> <a href="#documentation">↑</a></span></h2>
|
28
83
|
|
29
84
|
<p>A ruby library for reading and parsing qif files.</p>
|
30
85
|
|
@@ -37,73 +92,74 @@ each transaction.</p>
|
|
37
92
|
<p>Also includes DDL generation for importing the parsed categories and
|
38
93
|
transactions into a sqlite3 database.</p>
|
39
94
|
|
40
|
-
<h2>Install
|
95
|
+
<h2 id="label-Install">Install<span><a href="#label-Install">¶</a> <a href="#documentation">↑</a></span></h2>
|
41
96
|
|
42
97
|
<pre>gem install qiflib</pre>
|
43
98
|
|
44
|
-
<h2>Synopsis
|
99
|
+
<h2 id="label-Synopsis">Synopsis<span><a href="#label-Synopsis">¶</a> <a href="#documentation">↑</a></span></h2>
|
45
100
|
|
46
|
-
<pre># Parse the transactions from one or more files to csv
|
47
|
-
|
48
|
-
|
49
|
-
|
101
|
+
<pre class="ruby"><span class="ruby-comment"># Parse the transactions from one or more files to csv.</span>
|
102
|
+
<span class="ruby-comment"># Due to a discrepancy between the way iBank and Quicken export</span>
|
103
|
+
<span class="ruby-comment"># qif files, you need to specify either Qiflib::SOURCE_IBANK or</span>
|
104
|
+
<span class="ruby-comment"># Qiflib::SOURCE_QUICKEN as the :source.</span>
|
50
105
|
|
51
|
-
input_list = []
|
52
|
-
input_list
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
input_list
|
57
|
-
|
58
|
-
|
59
|
-
|
106
|
+
<span class="ruby-identifier">input_list</span> = []
|
107
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
108
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Chris'</span>,
|
109
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_cj.qif'</span>,
|
110
|
+
:<span class="ruby-identifier">source</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_IBANK</span> }
|
111
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
112
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Teri'</span>,
|
113
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_tj.qif'</span>,
|
114
|
+
:<span class="ruby-identifier">source</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_QUICKEN</span> }
|
60
115
|
|
61
|
-
csv_lines = Qiflib
|
116
|
+
<span class="ruby-identifier">csv_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">transactions_to_csv</span>(<span class="ruby-identifier">input_list</span>)
|
62
117
|
|
63
|
-
|
118
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">csv_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
|
64
119
|
|
65
|
-
|
66
|
-
|
120
|
+
<span class="ruby-comment"># Parse the transactions from one or more files to ^-delimited text. </span>
|
121
|
+
<span class="ruby-comment"># The text lines are suitable for loading to sqlite3.</span>
|
67
122
|
|
68
|
-
input_list = []
|
69
|
-
input_list
|
70
|
-
|
71
|
-
|
72
|
-
|
123
|
+
<span class="ruby-identifier">input_list</span> = []
|
124
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
125
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Chris'</span>,
|
126
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_cj.qif'</span>,
|
127
|
+
:<span class="ruby-identifier">source</span> =<span class="ruby-operator">></span> <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">SOURCE_IBANK</span> }
|
73
128
|
|
74
|
-
delim_lines = Qiflib
|
129
|
+
<span class="ruby-identifier">delim_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">transactions_to_delim</span>(<span class="ruby-identifier">input_list</span>)
|
75
130
|
|
76
|
-
|
131
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">delim_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
|
77
132
|
|
78
|
-
|
133
|
+
<span class="ruby-comment"># Parse the categories from one or more files to csv.</span>
|
79
134
|
|
80
|
-
input_list = [
|
81
|
-
csv_lines = Qiflib
|
135
|
+
<span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">'data/ibank_cj.qif'</span> ]
|
136
|
+
<span class="ruby-identifier">csv_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">catetory_names_to_csv</span>(<span class="ruby-identifier">input_list</span>)
|
82
137
|
|
83
|
-
|
138
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">csv_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
|
84
139
|
|
85
|
-
|
86
|
-
|
140
|
+
<span class="ruby-comment"># Parse the categories from one or more files to ^-delimited text. </span>
|
141
|
+
<span class="ruby-comment"># The text lines are suitable for loading to sqlite3. </span>
|
87
142
|
|
88
|
-
input_list = [
|
89
|
-
delim_lines = Qiflib
|
143
|
+
<span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">'data/ibank_cj.qif'</span> ]
|
144
|
+
<span class="ruby-identifier">delim_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">catetory_names_to_delim</span>(<span class="ruby-identifier">input_list</span>)
|
90
145
|
|
91
|
-
|
146
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">delim_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>
|
92
147
|
|
93
|
-
|
148
|
+
<span class="ruby-comment"># Generate the DDL for a sqlite3 database with categories and transactions tables.</span>
|
94
149
|
|
95
|
-
ddl_lines = Qiflib
|
150
|
+
<span class="ruby-identifier">ddl_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">generate_sqlite_ddl</span>
|
96
151
|
|
97
|
-
|
152
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">ddl_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>; <span class="ruby-identifier">use</span> <span class="ruby-identifier">it</span> <span class="ruby-keyword">in</span> <span class="ruby-identifier">the</span> <span class="ruby-identifier">following</span> <span class="ruby-identifier">bash</span><span class="ruby-operator">-</span><span class="ruby-identifier">shell</span> <span class="ruby-identifier">script</span>
|
98
153
|
|
99
|
-
|
100
|
-
|
154
|
+
<span class="ruby-comment"># Generate a bash-shell script to load the categories and transactions </span>
|
155
|
+
<span class="ruby-comment"># delimited files into a sqlite3 database, using the above DDL.</span>
|
101
156
|
|
102
|
-
sh_lines = Qiflib
|
157
|
+
<span class="ruby-identifier">sh_lines</span> = <span class="ruby-constant">Qiflib</span><span class="ruby-operator">::</span><span class="ruby-constant">Util</span>.<span class="ruby-identifier">generate_sqlite_load_script</span>
|
103
158
|
|
104
|
-
|
159
|
+
<span class="ruby-operator">...</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">sh_lines</span> <span class="ruby-identifier">to</span> <span class="ruby-identifier">a</span> <span class="ruby-identifier">file</span>; <span class="ruby-identifier">chmod</span> <span class="ruby-value">744</span>; <span class="ruby-identifier">run</span> <span class="ruby-identifier">it</span>.
|
160
|
+
</pre>
|
105
161
|
|
106
|
-
<h2>Generated DDL
|
162
|
+
<h2 id="label-Generated+DDL">Generated DDL<span><a href="#label-Generated+DDL">¶</a> <a href="#documentation">↑</a></span></h2>
|
107
163
|
|
108
164
|
<pre># DDL file for sqlite3
|
109
165
|
|
@@ -146,12 +202,12 @@ create table categories(
|
|
146
202
|
name varchar(80)
|
147
203
|
);
|
148
204
|
|
149
|
-
.separator
|
205
|
+
.separator '^'
|
150
206
|
|
151
207
|
.import qiflib_transactions.txt transactions
|
152
208
|
.import qiflib_categories.txt categories</pre>
|
153
209
|
|
154
|
-
<h2>Generated shell script
|
210
|
+
<h2 id="label-Generated+shell+script+">Generated shell script <span><a href="#label-Generated+shell+script+">¶</a> <a href="#documentation">↑</a></span></h2>
|
155
211
|
|
156
212
|
<pre># bash-shell script
|
157
213
|
|
@@ -159,104 +215,18 @@ create table categories(
|
|
159
215
|
|
160
216
|
sqlite3 qiflib.db < qiflib.ddl</pre>
|
161
217
|
|
162
|
-
<h2>Copyright and License
|
218
|
+
<h2 id="label-Copyright+and+License">Copyright and License<span><a href="#label-Copyright+and+License">¶</a> <a href="#documentation">↑</a></span></h2>
|
163
219
|
|
164
220
|
<p>Copyright 2013, Chris Joakim <cjoakim@bellsouth.net>.</p>
|
165
221
|
|
166
222
|
<p>GNU General Public License (GPLv3) license. See <a
|
167
223
|
href="http://www.gnu.org/copyleft/gpl.html">www.gnu.org/copyleft/gpl.html</a></p>
|
224
|
+
</div>
|
168
225
|
|
169
|
-
</div>
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
<h2>Files</h2>
|
175
|
-
<ul>
|
176
|
-
|
177
|
-
<li class="file"><a href="README_rdoc.html">README.rdoc</a></li>
|
178
|
-
|
179
|
-
</ul>
|
180
|
-
|
181
|
-
|
182
|
-
<h2 id="classes">Classes/Modules</h2>
|
183
|
-
<ul>
|
184
|
-
|
185
|
-
<li class="module"><a href="Qiflib.html">Qiflib</a></li>
|
186
|
-
|
187
|
-
<li class="class"><a href="Qiflib/Category.html">Qiflib::Category</a></li>
|
188
|
-
|
189
|
-
<li class="class"><a href="Qiflib/Date.html">Qiflib::Date</a></li>
|
190
|
-
|
191
|
-
<li class="class"><a href="Qiflib/Money.html">Qiflib::Money</a></li>
|
192
|
-
|
193
|
-
<li class="class"><a href="Qiflib/Transaction.html">Qiflib::Transaction</a></li>
|
194
|
-
|
195
|
-
<li class="class"><a href="Qiflib/Util.html">Qiflib::Util</a></li>
|
196
|
-
|
197
|
-
</ul>
|
198
226
|
|
199
|
-
|
200
|
-
<
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
<li><a href="Qiflib/Util.html#method-c-catetory_names_to_delim">::catetory_names_to_delim — Qiflib::Util</a></li>
|
205
|
-
|
206
|
-
<li><a href="Qiflib.html#method-c-csv_category_field_names">::csv_category_field_names — Qiflib</a></li>
|
207
|
-
|
208
|
-
<li><a href="Qiflib/Category.html#method-c-csv_header">::csv_header — Qiflib::Category</a></li>
|
209
|
-
|
210
|
-
<li><a href="Qiflib/Transaction.html#method-c-csv_header">::csv_header — Qiflib::Transaction</a></li>
|
211
|
-
|
212
|
-
<li><a href="Qiflib.html#method-c-csv_transaction_field_names">::csv_transaction_field_names — Qiflib</a></li>
|
213
|
-
|
214
|
-
<li><a href="Qiflib/Util.html#method-c-generate_sqlite_ddl">::generate_sqlite_ddl — Qiflib::Util</a></li>
|
215
|
-
|
216
|
-
<li><a href="Qiflib/Util.html#method-c-generate_sqlite_load_script">::generate_sqlite_load_script — Qiflib::Util</a></li>
|
217
|
-
|
218
|
-
<li><a href="Qiflib/Transaction.html#method-c-new">::new — Qiflib::Transaction</a></li>
|
219
|
-
|
220
|
-
<li><a href="Qiflib/Category.html#method-c-new">::new — Qiflib::Category</a></li>
|
221
|
-
|
222
|
-
<li><a href="Qiflib/Money.html#method-c-new">::new — Qiflib::Money</a></li>
|
223
|
-
|
224
|
-
<li><a href="Qiflib/Date.html#method-c-new">::new — Qiflib::Date</a></li>
|
225
|
-
|
226
|
-
<li><a href="Qiflib/Util.html#method-c-transactions_to_csv">::transactions_to_csv — Qiflib::Util</a></li>
|
227
|
-
|
228
|
-
<li><a href="Qiflib/Util.html#method-c-transactions_to_delim">::transactions_to_delim — Qiflib::Util</a></li>
|
229
|
-
|
230
|
-
<li><a href="Qiflib/Transaction.html#method-i-add_line">#add_line — Qiflib::Transaction</a></li>
|
231
|
-
|
232
|
-
<li><a href="Qiflib/Category.html#method-i-as_array">#as_array — Qiflib::Category</a></li>
|
233
|
-
|
234
|
-
<li><a href="Qiflib/Transaction.html#method-i-as_array">#as_array — Qiflib::Transaction</a></li>
|
235
|
-
|
236
|
-
<li><a href="Qiflib/Money.html#method-i-cents">#cents — Qiflib::Money</a></li>
|
237
|
-
|
238
|
-
<li><a href="Qiflib/Transaction.html#method-i-current_split">#current_split — Qiflib::Transaction</a></li>
|
239
|
-
|
240
|
-
<li><a href="Qiflib/Transaction.html#method-i-ibank-3F">#ibank? — Qiflib::Transaction</a></li>
|
241
|
-
|
242
|
-
<li><a href="Qiflib/Transaction.html#method-i-line_value">#line_value — Qiflib::Transaction</a></li>
|
243
|
-
|
244
|
-
<li><a href="Qiflib/Category.html#method-i-to_csv">#to_csv — Qiflib::Category</a></li>
|
245
|
-
|
246
|
-
<li><a href="Qiflib/Transaction.html#method-i-to_csv">#to_csv — Qiflib::Transaction</a></li>
|
247
|
-
|
248
|
-
<li><a href="Qiflib/Date.html#method-i-to_s">#to_s — Qiflib::Date</a></li>
|
249
|
-
|
250
|
-
<li><a href="Qiflib/Money.html#method-i-to_s">#to_s — Qiflib::Money</a></li>
|
251
|
-
|
252
|
-
<li><a href="Qiflib/Transaction.html#method-i-valid-3F">#valid? — Qiflib::Transaction</a></li>
|
253
|
-
|
254
|
-
</ul>
|
227
|
+
<footer id="validator-badges">
|
228
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
229
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
230
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
231
|
+
</footer>
|
255
232
|
|
256
|
-
<div id="validator-badges">
|
257
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
258
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
259
|
-
Rdoc Generator</a> 2</small>.</p>
|
260
|
-
</div>
|
261
|
-
</body>
|
262
|
-
</html>
|