]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - htsn-import.cabal
Add the format_commas function and use it to implement the earnings pickler.
[dead/htsn-import.git] / htsn-import.cabal
1 name: htsn-import
2 version: 0.0.5
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 category: Utils
7 license: GPL-3
8 license-file: doc/LICENSE
9 build-type: Simple
10 extra-source-files:
11 doc/dbschema/*.png
12 doc/htsn-importrc.example
13 doc/man1/htsn-import.1
14 doc/README.dbschema
15 doc/README.schemagen
16 doc/TODO
17 makefile
18 schema/*.dtd
19 schemagen/Auto_Racing_Schedule_XML/*.xml
20 schemagen/Heartbeat/*.xml
21 schemagen/injuriesxml/*.xml
22 schemagen/Injuries_Detail_XML/*.xml
23 schemagen/newsxml/*.xml
24 schemagen/Odds_XML/*.xml
25 schemagen/scoresxml/*.xml
26 schemagen/weatherxml/*.xml
27 test/shell/*.test
28 test/xml/*.xml
29 test/xml/*.dtd
30 synopsis:
31 Import XML files from The Sports Network into an RDBMS.
32 description:
33 /Usage/:
34 .
35 @
36 htsn-import [OPTIONS] [FILES]
37 @
38 .
39 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
40 containing various sports news and statistics. Our sister program
41 /htsn/ is capable of retrieving the feed and saving the individual
42 XML documents contained therein. But what to do with them?
43 .
44 The purpose of /htsn-import/ is to take these XML documents and
45 get them into something we can use, a relational database management
46 system (RDBMS), loosely known as a SQL database. The structure of
47 relational database, is, well, relational, and the feed XML is not. So
48 there is some work to do before the data can be inserted.
49 .
50 First, we must parse the XML. Each supported document type (see below)
51 has a full pickle/unpickle implementation (\"pickle\" is simply a
52 synonym for serialize here). That means that we parse the entire
53 document into a data structure, and if we pickle (serialize) that data
54 structure, we get the exact same XML document tha we started with.
55 .
56 This is important for two reasons. First, it serves as a second level
57 of validation. The first validation is performed by the XML parser,
58 but if that succeeds and unpicking fails, we know that something is
59 fishy. Second, we don't ever want to be surprised by some new element
60 or attribute showing up in the XML. The fact that we can unpickle the
61 whole thing now means that we won't be surprised in the future.
62 .
63 The aforementioned feature is especially important because we
64 automatically migrate the database schema every time we import a
65 document. If you attempt to import a \"newsxml.dtd\" document, all
66 database objects relating to the news will be created if they do not
67 exist. We don't want the schema to change out from under us without
68 warning, so it's important that no XML be parsed that would result in
69 a different schema than we had previously. Since we can
70 pickle/unpickle everything already, this should be impossible.
71 .
72 Examples and usage documentation are available in the man page.
73
74 executable htsn-import
75 build-depends:
76 base >= 4.6 && < 5,
77 cmdargs >= 0.10.6,
78 configurator >= 0.2,
79 directory >= 1.2,
80 filepath >= 1.3,
81 hslogger >= 1.2,
82 htsn-common >= 0.0.1,
83 hxt >= 9.3,
84 groundhog >= 0.5,
85 groundhog-postgresql >= 0.5,
86 groundhog-sqlite >= 0.5,
87 groundhog-th >= 0.5,
88 MissingH >= 1.2,
89 old-locale >= 1,
90 split >= 0.2,
91 tasty >= 0.8,
92 tasty-hunit >= 0.8,
93 time >= 1.4,
94 transformers >= 0.3,
95 tuple >= 0.2
96
97 main-is:
98 Main.hs
99
100 hs-source-dirs:
101 src/
102
103 other-modules:
104 Backend
105 CommandLine
106 Configuration
107 ConnectionString
108 ExitCodes
109 OptionalConfiguration
110 TSN.Codegen
111 TSN.Database
112 TSN.DbImport
113 TSN.Parse
114 TSN.Picklers
115 TSN.XmlImport
116 TSN.XML.AutoRacingResults
117 TSN.XML.AutoRacingSchedule
118 TSN.XML.GameInfo
119 TSN.XML.Heartbeat
120 TSN.XML.Injuries
121 TSN.XML.InjuriesDetail
122 TSN.XML.News
123 TSN.XML.Odds
124 TSN.XML.Scores
125 TSN.XML.SportInfo
126 TSN.XML.Weather
127 Xml
128
129 ghc-options:
130 -Wall
131 -fwarn-hi-shadowing
132 -fwarn-missing-signatures
133 -fwarn-name-shadowing
134 -fwarn-orphans
135 -fwarn-type-defaults
136 -fwarn-tabs
137 -fwarn-incomplete-record-updates
138 -fwarn-monomorphism-restriction
139 -fwarn-unused-do-bind
140 -O2
141
142 ghc-prof-options:
143 -prof
144 -fprof-auto
145 -fprof-cafs
146 -- The following unbreak profiling with template haskell. We have
147 -- to build the program twice; once without profile and again with
148 -- these flags.
149 -hisuf hi_p
150 -osuf o_p
151
152
153 test-suite testsuite
154 type: exitcode-stdio-1.0
155 hs-source-dirs: src test
156 main-is: TestSuite.hs
157 build-depends:
158 base >= 4.6 && < 5,
159 cmdargs >= 0.10.6,
160 configurator >= 0.2,
161 directory >= 1.2,
162 filepath >= 1.3,
163 hslogger >= 1.2,
164 htsn-common >= 0.0.1,
165 hxt >= 9.3,
166 groundhog >= 0.5,
167 groundhog-postgresql >= 0.5,
168 groundhog-sqlite >= 0.5,
169 groundhog-th >= 0.5,
170 MissingH >= 1.2,
171 old-locale >= 1,
172 split >= 0.2,
173 tasty >= 0.8,
174 tasty-hunit >= 0.8,
175 time >= 1.4,
176 transformers >= 0.3,
177 tuple >= 0.2
178
179 -- It's not entirely clear to me why I have to reproduce all of this.
180 ghc-options:
181 -Wall
182 -fwarn-hi-shadowing
183 -fwarn-missing-signatures
184 -fwarn-name-shadowing
185 -fwarn-orphans
186 -fwarn-type-defaults
187 -fwarn-tabs
188 -fwarn-incomplete-record-updates
189 -fwarn-monomorphism-restriction
190 -fwarn-unused-do-bind
191 -O2
192
193
194 test-suite doctests
195 type: exitcode-stdio-1.0
196 hs-source-dirs: test
197 main-is: Doctests.hs
198 build-depends:
199 base >= 4.6 && < 5,
200 -- Additional test dependencies.
201 doctest >= 0.9
202
203 -- It's not entirely clear to me why I have to reproduce all of this.
204 ghc-options:
205 -Wall
206 -fwarn-hi-shadowing
207 -fwarn-missing-signatures
208 -fwarn-name-shadowing
209 -fwarn-orphans
210 -fwarn-type-defaults
211 -fwarn-tabs
212 -fwarn-incomplete-record-updates
213 -fwarn-monomorphism-restriction
214 -fwarn-unused-do-bind
215 -rtsopts
216 -threaded
217 -optc-O3
218 -optc-march=native
219 -O2
220
221
222 -- These won't work without shelltestrunner installed in your
223 -- $PATH. Maybe there is some way to tell Cabal that.
224 test-suite shelltests
225 type: exitcode-stdio-1.0
226 hs-source-dirs: test
227 main-is: ShellTests.hs
228
229 build-depends:
230 base >= 4.6 && < 5,
231 cmdargs >= 0.10.6,
232 configurator >= 0.2,
233 directory >= 1.2,
234 filepath >= 1.3,
235 hslogger >= 1.2,
236 htsn-common >= 0.0.1,
237 hxt >= 9.3,
238 groundhog >= 0.5,
239 groundhog-postgresql >= 0.5,
240 groundhog-sqlite >= 0.5,
241 groundhog-th >= 0.5,
242 MissingH >= 1.2,
243 old-locale >= 1,
244 split >= 0.2,
245 process >= 1.1,
246 tasty >= 0.8,
247 tasty-hunit >= 0.8,
248 time >= 1.4,
249 transformers >= 0.3,
250 tuple >= 0.2
251
252
253
254 source-repository head
255 type: git
256 location: http://michael.orlitzky.com/git/htsn-import.git
257 branch: master