qiflib 0.1.0 → 0.2.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.
@@ -1,244 +1,236 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
4
 
5
5
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
6
  <head>
7
- <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
8
 
9
- <title>File: README.rdoc [qiflib]</title>
9
+ <title>File: README.rdoc [qiflib]</title>
10
10
 
11
- <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
11
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet" />
12
12
 
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>
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
21
  </head>
22
22
 
23
23
  <body class="file">
24
- <div id="metadata">
25
- <div id="home-metadata">
26
- <div id="home-section" class="section">
24
+ <div id="metadata">
25
+ <div id="home-metadata">
26
+ <div id="home-section" class="section">
27
27
  <h3 class="section-header">
28
28
  <a href="./index.html">Home</a>
29
29
  <a href="./index.html#classes">Classes</a>
30
30
  <a href="./index.html#methods">Methods</a>
31
31
  </h3>
32
- </div>
33
- </div>
34
-
35
- <div id="project-metadata">
36
-
37
-
38
- <div id="fileindex-section" class="section project-section">
39
- <h3 class="section-header">Files</h3>
40
- <ul>
41
-
42
- <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
43
-
44
- </ul>
45
- </div>
46
-
47
-
48
- <div id="classindex-section" class="section project-section">
49
- <h3 class="section-header">Class Index
50
- <span class="search-toggle"><img src="./images/find.png"
51
- height="16" width="16" alt="[+]"
52
- title="show/hide quicksearch" /></span></h3>
53
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
54
- <fieldset>
55
- <legend>Quicksearch</legend>
56
- <input type="text" name="quicksearch" value=""
57
- class="quicksearch-field" />
58
- </fieldset>
59
- </form>
60
-
61
- <ul class="link-list">
62
-
63
- <li><a href="./Qiflib.html">Qiflib</a></li>
64
-
65
- <li><a href="./Qiflib/Category.html">Qiflib::Category</a></li>
66
-
67
- <li><a href="./Qiflib/Date.html">Qiflib::Date</a></li>
68
-
69
- <li><a href="./Qiflib/Money.html">Qiflib::Money</a></li>
70
-
71
- <li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a></li>
72
-
73
- <li><a href="./Qiflib/Util.html">Qiflib::Util</a></li>
74
-
75
- </ul>
76
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
77
- </div>
78
-
79
-
80
- </div>
81
- </div>
82
-
83
- <div id="documentation">
84
- <h2><a href="Qiflib.html">Qiflib</a></h2>
85
- <p>
86
- A ruby library for reading and parsing qif files.
87
- </p>
88
- <p>
89
- Transaction parsing is supported, including address fields, and up to three
90
- &#8220;splits&#8221; per transaction. See the DDL, below, for the list of
91
- fields for each transaction.
92
- </p>
93
- <p>
94
- Category-name parsing is also supported.
95
- </p>
96
- <p>
97
- Also includes DDL generation for importing the parsed categories and
98
- transactions into a sqlite3 database.
99
- </p>
32
+ </div>
33
+ </div>
34
+
35
+ <div id="project-metadata">
36
+
37
+
38
+ <div id="fileindex-section" class="section project-section">
39
+ <h3 class="section-header">Files</h3>
40
+ <ul>
41
+
42
+ <li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
43
+
44
+ </ul>
45
+ </div>
46
+
47
+
48
+ <div id="classindex-section" class="section project-section">
49
+ <h3 class="section-header">Class Index
50
+ <span class="search-toggle"><img src="./images/find.png"
51
+ height="16" width="16" alt="[+]"
52
+ title="show/hide quicksearch" /></span></h3>
53
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
54
+ <fieldset>
55
+ <legend>Quicksearch</legend>
56
+ <input type="text" name="quicksearch" value=""
57
+ class="quicksearch-field" />
58
+ </fieldset>
59
+ </form>
60
+
61
+ <ul class="link-list">
62
+
63
+ <li><a href="./Qiflib.html">Qiflib</a></li>
64
+
65
+ <li><a href="./Qiflib/Category.html">Qiflib::Category</a></li>
66
+
67
+ <li><a href="./Qiflib/Date.html">Qiflib::Date</a></li>
68
+
69
+ <li><a href="./Qiflib/Money.html">Qiflib::Money</a></li>
70
+
71
+ <li><a href="./Qiflib/Transaction.html">Qiflib::Transaction</a></li>
72
+
73
+ <li><a href="./Qiflib/Util.html">Qiflib::Util</a></li>
74
+
75
+ </ul>
76
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
77
+ </div>
78
+
79
+
80
+ </div>
81
+ </div>
82
+
83
+ <div id="documentation">
84
+
85
+ <h2><a href="Qiflib.html">Qiflib</a></h2>
86
+
87
+ <p>A ruby library for reading and parsing qif files.</p>
88
+
89
+ <p>Transaction parsing is supported, including address fields, and up to three
90
+ splits per transaction. See the DDL, below, for the list of fields for
91
+ each transaction.</p>
92
+
93
+ <p>Category-name parsing is also supported.</p>
94
+
95
+ <p>Also includes DDL generation for importing the parsed categories and
96
+ transactions into a sqlite3 database.</p>
97
+
100
98
  <h2>Install</h2>
101
- <pre>
102
- gem install qiflib
103
- </pre>
99
+
100
+ <pre>gem install qiflib</pre>
101
+
104
102
  <h2>Synopsis</h2>
105
- <pre>
106
-
107
- # Parse the transactions from one or more files to csv.
108
- # Due to a discrepancy between the way iBank and Quicken export
109
- # qif files, you need to specify either Qiflib::SOURCE_IBANK or
110
- # Qiflib::SOURCE_QUICKEN as the :source.
111
-
112
- input_list = []
113
- input_list &lt;&lt; {
114
- :owner =&gt; 'Chris',
115
- :filename =&gt; 'data/ibank_cj.qif',
116
- :source =&gt; Qiflib::SOURCE_IBANK }
117
- input_list &lt;&lt; {
118
- :owner =&gt; 'Teri',
119
- :filename =&gt; 'data/ibank_tj.qif',
120
- :source =&gt; Qiflib::SOURCE_QUICKEN }
121
-
122
- csv_lines = Qiflib::Util.transactions_to_csv(input_list)
123
-
124
- ... write csv_lines to a file
125
-
126
- # Parse the transactions from one or more files to ^-delimited text.
127
- # The text lines are suitable for loading to sqlite3.
128
-
129
- input_list = []
130
- input_list &lt;&lt; {
131
- :owner =&gt; 'Chris',
132
- :filename =&gt; 'data/ibank_cj.qif',
133
- :source =&gt; Qiflib::SOURCE_IBANK }
134
-
135
- delim_lines = Qiflib::Util.transactions_to_delim(input_list)
136
-
137
- ... write delim_lines to a file
138
-
139
- # Parse the categories from one or more files to csv.
140
-
141
- input_list = [ 'data/ibank_cj.qif' ]
142
- csv_lines = Qiflib::Util.catetory_names_to_csv(input_list)
143
-
144
- ... write csv_lines to a file
145
-
146
-
147
- # Parse the categories from one or more files to ^-delimited text.
148
- # The text lines are suitable for loading to sqlite3.
149
-
150
- input_list = [ 'data/ibank_cj.qif' ]
151
- delim_lines = Qiflib::Util.catetory_names_to_delim(input_list)
152
-
153
- ... write delim_lines to a file
154
-
155
- # Generate the DDL for a sqlite3 database with categories and transactions tables.
156
-
157
- ddl_lines = Qiflib::Util.generate_sqlite_ddl
158
-
159
- ... write ddl_lines to a file; use it in the following bash-shell script
160
-
161
- # Generate a bash-shell script to load the categories and transactions
162
- # delimited files into a sqlite3 database, using the above DDL.
163
-
164
- sh_lines = Qiflib::Util.generate_sqlite_load_script
165
-
166
- ... write sh_lines to a file; chmod 744; run it.
167
- </pre>
103
+
104
+ <pre># Parse the transactions from one or more files to csv.
105
+ # Due to a discrepancy between the way iBank and Quicken export
106
+ # qif files, you need to specify either Qiflib::SOURCE_IBANK or
107
+ # Qiflib::SOURCE_QUICKEN as the :source.
108
+
109
+ input_list = []
110
+ input_list &lt;&lt; {
111
+ :owner =&gt; 'Chris',
112
+ :filename =&gt; 'data/ibank_cj.qif',
113
+ :source =&gt; Qiflib::SOURCE_IBANK }
114
+ input_list &lt;&lt; {
115
+ :owner =&gt; 'Teri',
116
+ :filename =&gt; 'data/ibank_tj.qif',
117
+ :source =&gt; Qiflib::SOURCE_QUICKEN }
118
+
119
+ csv_lines = Qiflib::Util.transactions_to_csv(input_list)
120
+
121
+ ... write csv_lines to a file
122
+
123
+ # Parse the transactions from one or more files to ^-delimited text.
124
+ # The text lines are suitable for loading to sqlite3.
125
+
126
+ input_list = []
127
+ input_list &lt;&lt; {
128
+ :owner =&gt; 'Chris',
129
+ :filename =&gt; 'data/ibank_cj.qif',
130
+ :source =&gt; Qiflib::SOURCE_IBANK }
131
+
132
+ delim_lines = Qiflib::Util.transactions_to_delim(input_list)
133
+
134
+ ... write delim_lines to a file
135
+
136
+ # Parse the categories from one or more files to csv.
137
+
138
+ input_list = [ 'data/ibank_cj.qif' ]
139
+ csv_lines = Qiflib::Util.catetory_names_to_csv(input_list)
140
+
141
+ ... write csv_lines to a file
142
+
143
+ # Parse the categories from one or more files to ^-delimited text.
144
+ # The text lines are suitable for loading to sqlite3.
145
+
146
+ input_list = [ 'data/ibank_cj.qif' ]
147
+ delim_lines = Qiflib::Util.catetory_names_to_delim(input_list)
148
+
149
+ ... write delim_lines to a file
150
+
151
+ # Generate the DDL for a sqlite3 database with categories and transactions tables.
152
+
153
+ ddl_lines = Qiflib::Util.generate_sqlite_ddl
154
+
155
+ ... write ddl_lines to a file; use it in the following bash-shell script
156
+
157
+ # Generate a bash-shell script to load the categories and transactions
158
+ # delimited files into a sqlite3 database, using the above DDL.
159
+
160
+ sh_lines = Qiflib::Util.generate_sqlite_load_script
161
+
162
+ ... write sh_lines to a file; chmod 744; run it.</pre>
163
+
168
164
  <h2>Generated DDL</h2>
169
- <pre>
170
- # DDL file for sqlite3
171
-
172
- drop table if exists transactions;
173
- drop table if exists categories;
174
-
175
- create table transactions(
176
- id integer,
177
- acct_owner varchar(80),
178
- acct_name varchar(80),
179
- acct_type varchar(80),
180
- date varchar(80),
181
- amount real,
182
- number varchar(80),
183
- ibank_n varchar(80),
184
- cleared varchar(80),
185
- payee varchar(80),
186
- category varchar(80),
187
- memo varchar(80),
188
- split1_amount real,
189
- split1_category varchar(80),
190
- split1_memo real,
191
- split2_amount varchar(80),
192
- split2_category varchar(80),
193
- split2_memo varchar(80),
194
- split3_amount real,
195
- split3_category varchar(80),
196
- split3_memo varchar(80),
197
- address1 varchar(80),
198
- address2 varchar(80),
199
- address3 varchar(80),
200
- address4 varchar(80),
201
- address5 varchar(80),
202
- address6 varchar(80),
203
- eol_ind char(1)
204
- );
205
-
206
- create table categories(
207
- id integer,
208
- name varchar(80)
209
- );
210
-
211
- .separator '^'
212
-
213
- .import qiflib_transactions.txt transactions
214
- .import qiflib_categories.txt categories
215
- </pre>
165
+
166
+ <pre># DDL file for sqlite3
167
+
168
+ drop table if exists transactions;
169
+ drop table if exists categories;
170
+
171
+ create table transactions(
172
+ id integer,
173
+ acct_owner varchar(80),
174
+ acct_name varchar(80),
175
+ acct_type varchar(80),
176
+ date varchar(80),
177
+ amount real,
178
+ number varchar(80),
179
+ ibank_n varchar(80),
180
+ cleared varchar(80),
181
+ payee varchar(80),
182
+ category varchar(80),
183
+ memo varchar(80),
184
+ split1_amount real,
185
+ split1_category varchar(80),
186
+ split1_memo real,
187
+ split2_amount varchar(80),
188
+ split2_category varchar(80),
189
+ split2_memo varchar(80),
190
+ split3_amount real,
191
+ split3_category varchar(80),
192
+ split3_memo varchar(80),
193
+ address1 varchar(80),
194
+ address2 varchar(80),
195
+ address3 varchar(80),
196
+ address4 varchar(80),
197
+ address5 varchar(80),
198
+ address6 varchar(80),
199
+ eol_ind char(1)
200
+ );
201
+
202
+ create table categories(
203
+ id integer,
204
+ name varchar(80)
205
+ );
206
+
207
+ .separator '^'
208
+
209
+ .import qiflib_transactions.txt transactions
210
+ .import qiflib_categories.txt categories</pre>
211
+
216
212
  <h2>Generated shell script </h2>
217
- <pre>
218
- # bash-shell script
219
213
 
220
- #!/bin/bash
214
+ <pre># bash-shell script
215
+
216
+ #!/bin/bash
217
+
218
+ sqlite3 qiflib.db &lt; qiflib.ddl</pre>
221
219
 
222
- sqlite3 qiflib.db &lt; qiflib.ddl
223
-
224
-
225
- </pre>
226
220
  <h2>Copyright and License</h2>
227
- <p>
228
- Copyright 2012, Chris Joakim <cjoakim@bellsouth.net>.
229
- </p>
230
- <p>
231
- GNU General Public License (GPLv3) license. See <a
232
- href="http://www.gnu.org/copyleft/gpl.html">www.gnu.org/copyleft/gpl.html</a>
233
- </p>
234
-
235
- </div>
236
-
237
- <div id="validator-badges">
238
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
239
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
240
- Rdoc Generator</a> 1.1.6</small>.</p>
241
- </div>
221
+
222
+ <p>Copyright 2013, Chris Joakim &lt;cjoakim@bellsouth.net&gt;.</p>
223
+
224
+ <p>GNU General Public License (GPLv3) license. See <a
225
+ href="http://www.gnu.org/copyleft/gpl.html">www.gnu.org/copyleft/gpl.html</a></p>
226
+
227
+ </div>
228
+
229
+ <div id="validator-badges">
230
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
231
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
232
+ Rdoc Generator</a> 2</small>.</p>
233
+ </div>
242
234
  </body>
243
235
  </html>
244
236