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