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/README_rdoc.html
CHANGED
@@ -1,88 +1,101 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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>README - qiflib</title>
|
10
8
|
|
11
|
-
|
9
|
+
<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
|
10
|
+
|
11
|
+
<script type="text/javascript">
|
12
|
+
var rdoc_rel_prefix = "./";
|
13
|
+
</script>
|
14
|
+
|
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>
|
12
21
|
|
13
|
-
<script src="./js/jquery.js" type="text/javascript"
|
14
|
-
charset="utf-8"></script>
|
15
|
-
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
16
|
-
charset="utf-8"></script>
|
17
|
-
<script src="./js/quicksearch.js" type="text/javascript"
|
18
|
-
charset="utf-8"></script>
|
19
|
-
<script src="./js/darkfish.js" type="text/javascript"
|
20
|
-
charset="utf-8"></script>
|
21
|
-
</head>
|
22
22
|
|
23
23
|
<body class="file">
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
</
|
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
|
+
|
47
|
+
<div id="table-of-contents">
|
48
|
+
<nav class="section">
|
49
|
+
<h3 class="section-header">Table of Contents</h3>
|
50
|
+
<ul>
|
51
|
+
<li><a href="#label-Qiflib">Qiflib</a>
|
52
|
+
<li><a href="#label-Install">Install</a>
|
53
|
+
<li><a href="#label-Synopsis">Synopsis</a>
|
54
|
+
<li><a href="#label-Generated+DDL">Generated DDL</a>
|
55
|
+
<li><a href="#label-Generated+shell+script+">Generated shell script </a>
|
56
|
+
<li><a href="#label-Copyright+and+License">Copyright and License</a>
|
57
|
+
</ul>
|
58
|
+
</nav>
|
59
|
+
</div>
|
60
|
+
|
61
|
+
|
62
|
+
<div id="project-metadata">
|
63
|
+
<nav id="fileindex-section" class="section project-section">
|
64
|
+
<h3 class="section-header">Pages</h3>
|
65
|
+
|
66
|
+
<ul>
|
67
|
+
|
68
|
+
<li class="file"><a href="./README_rdoc.html">README</a>
|
69
|
+
|
70
|
+
</ul>
|
71
|
+
</nav>
|
72
|
+
|
73
|
+
<nav id="classindex-section" class="section project-section">
|
74
|
+
<h3 class="section-header">Class and Module Index</h3>
|
75
|
+
|
76
|
+
<ul class="link-list">
|
77
|
+
|
78
|
+
<li><a href="./Qiflib.html">Qiflib</a>
|
79
|
+
|
80
|
+
<li><a href="./Qiflib/Category.html">Qiflib::Category</a>
|
81
|
+
|
82
|
+
<li><a href="./Qiflib/Date.html">Qiflib::Date</a>
|
83
|
+
|
84
|
+
<li><a href="./Qiflib/Money.html">Qiflib::Money</a>
|
85
|
+
|
86
|
+
<li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a>
|
87
|
+
|
88
|
+
<li><a href="./Qiflib/Util.html">Qiflib::Util</a>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</nav>
|
92
|
+
|
81
93
|
</div>
|
94
|
+
</nav>
|
82
95
|
|
83
|
-
|
84
|
-
|
85
|
-
<h2><a href="Qiflib.html">Qiflib</a></h2>
|
96
|
+
<div id="documentation" class="description">
|
97
|
+
|
98
|
+
<h2 id="label-Qiflib"><a href="Qiflib.html">Qiflib</a><span><a href="#label-Qiflib">¶</a> <a href="#documentation">↑</a></span></h2>
|
86
99
|
|
87
100
|
<p>A ruby library for reading and parsing qif files.</p>
|
88
101
|
|
@@ -95,73 +108,74 @@ each transaction.</p>
|
|
95
108
|
<p>Also includes DDL generation for importing the parsed categories and
|
96
109
|
transactions into a sqlite3 database.</p>
|
97
110
|
|
98
|
-
<h2>Install
|
111
|
+
<h2 id="label-Install">Install<span><a href="#label-Install">¶</a> <a href="#documentation">↑</a></span></h2>
|
99
112
|
|
100
113
|
<pre>gem install qiflib</pre>
|
101
114
|
|
102
|
-
<h2>Synopsis
|
115
|
+
<h2 id="label-Synopsis">Synopsis<span><a href="#label-Synopsis">¶</a> <a href="#documentation">↑</a></span></h2>
|
103
116
|
|
104
|
-
<pre># Parse the transactions from one or more files to csv
|
105
|
-
|
106
|
-
|
107
|
-
|
117
|
+
<pre class="ruby"><span class="ruby-comment"># Parse the transactions from one or more files to csv.</span>
|
118
|
+
<span class="ruby-comment"># Due to a discrepancy between the way iBank and Quicken export</span>
|
119
|
+
<span class="ruby-comment"># qif files, you need to specify either Qiflib::SOURCE_IBANK or</span>
|
120
|
+
<span class="ruby-comment"># Qiflib::SOURCE_QUICKEN as the :source.</span>
|
108
121
|
|
109
|
-
input_list = []
|
110
|
-
input_list
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
input_list
|
115
|
-
|
116
|
-
|
117
|
-
|
122
|
+
<span class="ruby-identifier">input_list</span> = []
|
123
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
124
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Chris'</span>,
|
125
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_cj.qif'</span>,
|
126
|
+
:<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> }
|
127
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
128
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Teri'</span>,
|
129
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_tj.qif'</span>,
|
130
|
+
:<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> }
|
118
131
|
|
119
|
-
csv_lines = Qiflib
|
132
|
+
<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>)
|
120
133
|
|
121
|
-
|
134
|
+
<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>
|
122
135
|
|
123
|
-
|
124
|
-
|
136
|
+
<span class="ruby-comment"># Parse the transactions from one or more files to ^-delimited text. </span>
|
137
|
+
<span class="ruby-comment"># The text lines are suitable for loading to sqlite3.</span>
|
125
138
|
|
126
|
-
input_list = []
|
127
|
-
input_list
|
128
|
-
|
129
|
-
|
130
|
-
|
139
|
+
<span class="ruby-identifier">input_list</span> = []
|
140
|
+
<span class="ruby-identifier">input_list</span> <span class="ruby-operator"><<</span> {
|
141
|
+
:<span class="ruby-identifier">owner</span> =<span class="ruby-operator">></span> <span class="ruby-string">'Chris'</span>,
|
142
|
+
:<span class="ruby-identifier">filename</span> =<span class="ruby-operator">></span> <span class="ruby-string">'data/ibank_cj.qif'</span>,
|
143
|
+
:<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> }
|
131
144
|
|
132
|
-
delim_lines = Qiflib
|
145
|
+
<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>)
|
133
146
|
|
134
|
-
|
147
|
+
<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>
|
135
148
|
|
136
|
-
|
149
|
+
<span class="ruby-comment"># Parse the categories from one or more files to csv.</span>
|
137
150
|
|
138
|
-
input_list = [
|
139
|
-
csv_lines = Qiflib
|
151
|
+
<span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">'data/ibank_cj.qif'</span> ]
|
152
|
+
<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>)
|
140
153
|
|
141
|
-
|
154
|
+
<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>
|
142
155
|
|
143
|
-
|
144
|
-
|
156
|
+
<span class="ruby-comment"># Parse the categories from one or more files to ^-delimited text. </span>
|
157
|
+
<span class="ruby-comment"># The text lines are suitable for loading to sqlite3. </span>
|
145
158
|
|
146
|
-
input_list = [
|
147
|
-
delim_lines = Qiflib
|
159
|
+
<span class="ruby-identifier">input_list</span> = [ <span class="ruby-string">'data/ibank_cj.qif'</span> ]
|
160
|
+
<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>)
|
148
161
|
|
149
|
-
|
162
|
+
<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>
|
150
163
|
|
151
|
-
|
164
|
+
<span class="ruby-comment"># Generate the DDL for a sqlite3 database with categories and transactions tables.</span>
|
152
165
|
|
153
|
-
ddl_lines = Qiflib
|
166
|
+
<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>
|
154
167
|
|
155
|
-
|
168
|
+
<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>
|
156
169
|
|
157
|
-
|
158
|
-
|
170
|
+
<span class="ruby-comment"># Generate a bash-shell script to load the categories and transactions </span>
|
171
|
+
<span class="ruby-comment"># delimited files into a sqlite3 database, using the above DDL.</span>
|
159
172
|
|
160
|
-
sh_lines = Qiflib
|
173
|
+
<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>
|
161
174
|
|
162
|
-
|
175
|
+
<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>.
|
176
|
+
</pre>
|
163
177
|
|
164
|
-
<h2>Generated DDL
|
178
|
+
<h2 id="label-Generated+DDL">Generated DDL<span><a href="#label-Generated+DDL">¶</a> <a href="#documentation">↑</a></span></h2>
|
165
179
|
|
166
180
|
<pre># DDL file for sqlite3
|
167
181
|
|
@@ -204,12 +218,12 @@ create table categories(
|
|
204
218
|
name varchar(80)
|
205
219
|
);
|
206
220
|
|
207
|
-
.separator
|
221
|
+
.separator '^'
|
208
222
|
|
209
223
|
.import qiflib_transactions.txt transactions
|
210
224
|
.import qiflib_categories.txt categories</pre>
|
211
225
|
|
212
|
-
<h2>Generated shell script
|
226
|
+
<h2 id="label-Generated+shell+script+">Generated shell script <span><a href="#label-Generated+shell+script+">¶</a> <a href="#documentation">↑</a></span></h2>
|
213
227
|
|
214
228
|
<pre># bash-shell script
|
215
229
|
|
@@ -217,20 +231,20 @@ create table categories(
|
|
217
231
|
|
218
232
|
sqlite3 qiflib.db < qiflib.ddl</pre>
|
219
233
|
|
220
|
-
<h2>Copyright and License
|
234
|
+
<h2 id="label-Copyright+and+License">Copyright and License<span><a href="#label-Copyright+and+License">¶</a> <a href="#documentation">↑</a></span></h2>
|
221
235
|
|
222
236
|
<p>Copyright 2013, Chris Joakim <cjoakim@bellsouth.net>.</p>
|
223
237
|
|
224
238
|
<p>GNU General Public License (GPLv3) license. See <a
|
225
239
|
href="http://www.gnu.org/copyleft/gpl.html">www.gnu.org/copyleft/gpl.html</a></p>
|
226
240
|
|
227
|
-
|
241
|
+
</div>
|
228
242
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
</
|
234
|
-
</
|
235
|
-
</
|
243
|
+
|
244
|
+
|
245
|
+
<footer id="validator-badges">
|
246
|
+
<p><a href="http://validator.w3.org/check/referer">[Validate]</a>
|
247
|
+
<p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 4.0.0.
|
248
|
+
<p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
|
249
|
+
</footer>
|
236
250
|
|