]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - htsn-import.cabal
ca1898434b3dc8f9566705361999ec91fecd452b
[dead/htsn-import.git] / htsn-import.cabal
1 name: htsn-import
2 version: 0.2.0
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/CHANGES.database
15 doc/README.development
16 doc/TODO
17 makefile
18 schema/*.dtd
19 schemagen/AutoRacingResultsXML/*.xml
20 schemagen/Auto_Racing_Schedule_XML/*.xml
21 schemagen/CBASK_3PPctXML/*.xml
22 schemagen/Cbask_All_Tourn_Teams_XML/*.xml
23 schemagen/CBASK_AssistsXML/*.xml
24 schemagen/Cbask_Awards_XML/*.xml
25 schemagen/CBASK_BlocksXML/*.xml
26 schemagen/Cbask_Conf_Standings_XML/*.xml
27 schemagen/Cbask_DivII_III_Indv_Stats_XML/*.xml
28 schemagen/Cbask_DivIII_Team_Stats_XML/*.xml
29 schemagen/Cbask_DivII_Team_Stats_XML/*.xml
30 schemagen/CBASK_FGPctXML/*.xml
31 schemagen/CBASK_FoulsXML/*.xml
32 schemagen/CBASK_FTPctXML/*.xml
33 schemagen/Cbask_Indv_No_Avg_XML/*.xml
34 schemagen/Cbask_Indv_Scoring_XML/*.xml
35 schemagen/CBASK_Lineup_XML/*.xml
36 schemagen/CBASK_MinutesXML/*.xml
37 schemagen/Cbask_Polls_XML/*.xml
38 schemagen/cbaskpreviewxml/*.xml
39 schemagen/CBASK_ReboundsXML/*.xml
40 schemagen/CBASK_ScoringLeadersXML/*.xml
41 schemagen/Cbask_Team_ThreePT_Made_XML/*.xml
42 schemagen/Cbask_Team_ThreePT_PCT_XML/*.xml
43 schemagen/Cbask_Team_Win_Pct_XML/*.xml
44 schemagen/CBASK_TopTwentyFiveResult_XML/*.xml
45 schemagen/Cbask_Top_Twenty_Five_XML/*.xml
46 schemagen/Cbask_Tourn_Awards_XML/*.xml
47 schemagen/Cbask_Tourn_Champs_XML/*.xml
48 schemagen/Cbask_Tourn_Indiv_XML/*.xml
49 schemagen/Cbask_Tourn_Leaders_XML/*.xml
50 schemagen/Cbask_Tourn_MVP_XML/*.xml
51 schemagen/Cbask_Tourn_Records_XML/*.xml
52 schemagen/cflpreviewxml/*.xml
53 schemagen/earlylineXML/*.xml
54 schemagen/Heartbeat/*.xml
55 schemagen/Injuries_Detail_XML/*.xml
56 schemagen/injuriesxml/*.xml
57 schemagen/jfilexml/*.xml
58 schemagen/LeagueScheduleXML/*.xml
59 schemagen/Matchup_NBA_NHL_XML/*.xml
60 schemagen/Minor_Baseball_League_Leaders_XML/*.xml
61 schemagen/Minor_Baseball_Standings_XML/*.xml
62 schemagen/Minor_Baseball_Transactions_XML/*.xml
63 schemagen/minorscoresxml/*.xml
64 schemagen/mlbbattingavgxml/*.xml
65 schemagen/mlbdoublesleadersxml/*.xml
66 schemagen/MLB_Boxscore_XML/*.xml
67 schemagen/MLB_ERA_Leaders/*.xml
68 schemagen/MLB_Fielding_XML/*.xml
69 schemagen/MLBGamesPlayedXML/*.xml
70 schemagen/MLB_Gaming_Matchup_XML/*.xml
71 schemagen/MLBGIDPXML/*.xml
72 schemagen/MLBHitByPitchXML/*.xml
73 schemagen/mlbhitsleadersxml/*.xml
74 schemagen/mlbhomerunsxml/*.xml
75 schemagen/MLBHRFreqXML/*.xml
76 schemagen/MLBIntWalksXML/*.xml
77 schemagen/MLBKORateXML/*.xml
78 schemagen/MLB_Lineup_XML/*.xml
79 schemagen/MLB_Matchup_XML/*.xml
80 schemagen/mlbonbasepctxml/*.xml
81 schemagen/MLBOPSXML/*.xml
82 schemagen/MLB_earlylineXML/*.xml
83 schemagen/MLB_Pitching_Appearances_Leaders/*.xml
84 schemagen/MLB_Pitching_Balks_Leaders/*.xml
85 schemagen/MLB_Pitching_CG_Leaders/*.xml
86 schemagen/MLB_Pitching_ER_Allowed_Leaders/*.xml
87 schemagen/MLB_Pitching_Hit_Batters_Leaders/*.xml
88 schemagen/MLB_Pitching_Hits_Allowed_Leaders/*.xml
89 schemagen/MLB_Pitching_HR_Allowed_Leaders/*.xml
90 schemagen/MLB_Pitching_IP_Leaders/*.xml
91 schemagen/MLB_Pitching_Runs_Allowed_Leaders/*.xml
92 schemagen/MLB_Pitching_Saves_Leaders/*.xml
93 schemagen/MLB_Pitching_Shut_Outs_Leaders/*.xml
94 schemagen/MLB_Pitching_Starts_Leaders/*.xml
95 schemagen/MLB_Pitching_Strike_Outs_Leaders/*.xml
96 schemagen/MLB_Pitching_Walks_Leaders/*.xml
97 schemagen/MLB_Pitching_WHIP_Leaders/*.xml
98 schemagen/MLB_Pitching_Wild_Pitches_Leaders/*.xml
99 schemagen/MLB_Pitching_Win_Percentage_Leaders/*.xml
100 schemagen/MLB_Pitching_WL_Leaders/*.xml
101 schemagen/MLBPlateAppsXML/*.xml
102 schemagen/mlbpreviewxml/*.xml
103 schemagen/mlbrbisxml/*.xml
104 schemagen/mlbrunsleadersxml/*.xml
105 schemagen/MLBSacFliesXML/*.xml
106 schemagen/MLBSacrificesXML/*.xml
107 schemagen/MLBSBSuccessXML/*.xml
108 schemagen/mlbsluggingpctxml/*.xml
109 schemagen/mlbstandxml/*.xml
110 schemagen/mlbstandxml_preseason/*.xml
111 schemagen/mlbstolenbasexml/*.xml
112 schemagen/mlbtotalbasesleadersxml/*.xml
113 schemagen/mlbtriplesleadersxml/*.xml
114 schemagen/MLBWalkRateXML/*.xml
115 schemagen/mlbwalksleadersxml/*.xml
116 schemagen/MLBXtraBaseHitsXML/*.xml
117 schemagen/MLS_Preview_XML/*.xml
118 schemagen/NBA3PPctXML/*.xml
119 schemagen/NBAAssistsXML/*.xml
120 schemagen/NBABlocksXML/*.xml
121 schemagen/nbaconfrecxml/*.xml
122 schemagen/nbadaysxml/*.xml
123 schemagen/nbadivisionsxml/*.xml
124 schemagen/NBAFGPctXML/*.xml
125 schemagen/NBAFoulsXML/*.xml
126 schemagen/NBAFTPctXML/*.xml
127 schemagen/NBA_Gaming_Matchup_XML/*.xml
128 schemagen/NBALineupXML/*.xml
129 schemagen/NBAMinutesXML/*.xml
130 schemagen/NBA_Playoff_Matchup_XML/*.xml
131 schemagen/nbapreviewxml/*.xml
132 schemagen/NBAReboundsXML/*.xml
133 schemagen/NBAScorersXML/*.xml
134 schemagen/nbastandxml/*.xml
135 schemagen/NBAStealsXML/*.xml
136 schemagen/nbateamleadersxml/*.xml
137 schemagen/NBA_Team_Stats_XML/*.xml
138 schemagen/nbatripledoublexml/*.xml
139 schemagen/NBATurnoversXML/*.xml
140 schemagen/NCAA_Conference_Schedule_XML/*.xml
141 schemagen/NCAA_FB_Preview_XML/*.xml
142 schemagen/newsxml/*.xml
143 schemagen/nflfirstdownxml/*.xml
144 schemagen/NFLFumbleLeaderXML/*.xml
145 schemagen/NFLGiveTakeXML/*.xml
146 schemagen/NFLGrassTurfDomeOutsideXML/*.xml
147 schemagen/NFLInside20XML/*.xml
148 schemagen/NFLInterceptionLeadersXML/*.xml
149 schemagen/NFL_KickingLeaders_XML/*.xml
150 schemagen/NFLKickoffsXML/*.xml
151 schemagen/NFLMondayNightXML/*.xml
152 schemagen/NFL_NBA_Draft_XML/*.xml
153 schemagen/NFL_NCAA_FB_Matchup_XML/*.xml
154 schemagen/NFLPassingLeadersXML/*.xml
155 schemagen/NFLPassLeadXML/*.xml
156 schemagen/nflpreviewxml/*.xml
157 schemagen/NFL_PuntingLeaders_XML/*.xml
158 schemagen/NFLQBStartsXML/*.xml
159 schemagen/NFLReceivingLeadersXML/*.xml
160 schemagen/NFL_Roster_XML/*.xml
161 schemagen/NFLRushingLeadersXML/*.xml
162 schemagen/NFLSackLeadersXML/*.xml
163 schemagen/nflstandxml/*.xml
164 schemagen/NFLTackleFFLeadersXML/*.xml
165 schemagen/NFLTeamRankingsXML/*.xml
166 schemagen/NFL_Team_Stats_XML/*.xml
167 schemagen/NFLTopKickoffReturnXML/*.xml
168 schemagen/NFLTopPerformanceXML/*.xml
169 schemagen/NFLTopPuntReturnXML/*.xml
170 schemagen/NFLTotalYardageXML/*.xml
171 schemagen/NFLYardsXML/*.xml
172 schemagen/nhlpreviewxml/*.xml
173 schemagen/Odds_XML/*.xml
174 schemagen/recapxml/*.xml
175 schemagen/Schedule_Changes_XML/*.xml
176 schemagen/scoresxml/*.xml
177 schemagen/Transactions_XML/*.xml
178 schemagen/weatherxml/*.xml
179 schemagen/Weekly_Sched_XML/*.xml
180 schemagen/WNBA3PPctXML/*.xml
181 schemagen/WNBAAssistsXML/*.xml
182 schemagen/WNBABlocksXML/*.xml
183 schemagen/WNBAFGPctXML/*.xml
184 schemagen/WNBAFoulsXML/*.xml
185 schemagen/WNBAFTPctXML/*.xml
186 schemagen/WNBAMinutesXML/*.xml
187 schemagen/WNBAReboundsXML/*.xml
188 schemagen/WNBAScorersXML/*.xml
189 schemagen/wnbastandxml/*.xml
190 schemagen/WNBAStealsXML/*.xml
191 schemagen/WNBA_Team_Leaders_XML/*.xml
192 schemagen/WNBATurnoversXML/*.xml
193 schemagen/WorldBaseballPreviewXML/*.xml
194 test/shell/*.test
195 test/xml/*.xml
196 test/xml/*.dtd
197 test/xml/gameinfo/*.xml
198 test/xml/gameinfo/*.dtd
199 test/xml/sportinfo/*.xml
200 test/xml/sportinfo/*.dtd
201 synopsis:
202 Import XML files from The Sports Network into an RDBMS.
203 description:
204 /Usage/:
205 .
206 @
207 htsn-import [OPTIONS] [FILES]
208 @
209 .
210 The Sports Network <http://www.sportsnetwork.com/> offers an XML feed
211 containing various sports news and statistics. Our sister program
212 /htsn/ is capable of retrieving the feed and saving the individual
213 XML documents contained therein. But what to do with them?
214 .
215 The purpose of /htsn-import/ is to take these XML documents and
216 get them into something we can use, a relational database management
217 system (RDBMS), i.e. \"a SQL database\". The structure of
218 relational database, is, well, relational, and the feed XML is not. So
219 there is some work to do before the data can be inserted.
220 .
221 First, we must parse the XML. Each supported document type (see below)
222 has a full pickle/unpickle implementation (\"pickle\" is simply a
223 synonym for serialize here). That means that we parse the entire
224 document into a data structure, and if we pickle (serialize) that data
225 structure, we get the exact same XML document tha we started with.
226 .
227 This is important for two reasons. First, it serves as a second level
228 of validation. The first validation is performed by the XML parser,
229 but if that succeeds and unpicking fails, we know that something is
230 fishy. Second, we don't ever want to be surprised by some new element
231 or attribute showing up in the XML. The fact that we can unpickle the
232 whole thing now means that we won't be surprised in the future.
233 .
234 The aforementioned feature is especially important because we
235 automatically migrate the database schema every time we import a
236 document. If you attempt to import a \"newsxml.dtd\" document, all
237 database objects relating to the news will be created if they do not
238 exist. We don't want the schema to change out from under us without
239 warning, so it's important that no XML be parsed that would result in
240 a different schema than we had previously. Since we can
241 pickle/unpickle everything already, this should be impossible.
242 .
243 Examples and usage documentation are available in the man page.
244
245 executable htsn-import
246 build-depends:
247 base >= 4.6 && < 5,
248 cmdargs >= 0.10.6,
249 configurator >= 0.2,
250 directory >= 1.2,
251 filepath >= 1.3,
252 hslogger >= 1.2,
253 htsn-common >= 0.0.1,
254 hxt >= 9.3,
255 generics-sop >= 0.1,
256 groundhog >= 0.5,
257 groundhog-postgresql >= 0.5,
258 groundhog-sqlite >= 0.5,
259 groundhog-th >= 0.5,
260 MissingH >= 1.2,
261 old-locale >= 1,
262 split >= 0.2,
263 tasty >= 0.8,
264 tasty-hunit >= 0.8,
265 time >= 1.4,
266 transformers >= 0.3,
267 tuple >= 0.2
268
269 main-is:
270 Main.hs
271
272 hs-source-dirs:
273 src/
274
275 other-modules:
276 Backend
277 CommandLine
278 Configuration
279 ConnectionString
280 ExitCodes
281 Generics
282 OptionalConfiguration
283 TSN.Codegen
284 TSN.Database
285 TSN.DbImport
286 TSN.Location
287 TSN.Parse
288 TSN.Picklers
289 TSN.Team
290 TSN.XmlImport
291 TSN.XML.AutoRacingDriverList
292 TSN.XML.AutoRacingResults
293 TSN.XML.AutoRacingSchedule
294 TSN.XML.EarlyLine
295 TSN.XML.GameInfo
296 TSN.XML.Heartbeat
297 TSN.XML.Injuries
298 TSN.XML.InjuriesDetail
299 TSN.XML.JFile
300 TSN.XML.MLBBoxScore
301 TSN.XML.MLBEarlyLine
302 TSN.XML.News
303 TSN.XML.Odds
304 TSN.XML.ScheduleChanges
305 TSN.XML.Scores
306 TSN.XML.SportInfo
307 TSN.XML.Weather
308 Xml
309
310 ghc-options:
311 -Wall
312 -fcontext-stack=50
313 -fwarn-hi-shadowing
314 -fwarn-missing-signatures
315 -fwarn-name-shadowing
316 -fwarn-orphans
317 -fwarn-type-defaults
318 -fwarn-tabs
319 -fwarn-incomplete-record-updates
320 -fwarn-monomorphism-restriction
321 -fwarn-unused-do-bind
322 -O2
323
324 ghc-prof-options:
325 -prof
326 -fprof-auto
327 -fprof-cafs
328 -- The following unbreak profiling with template haskell. We have
329 -- to build the program twice; once without profile and again with
330 -- these flags.
331 -hisuf hi_p
332 -osuf o_p
333
334
335 test-suite testsuite
336 type: exitcode-stdio-1.0
337 hs-source-dirs: src test
338 main-is: TestSuite.hs
339 build-depends:
340 base >= 4.6 && < 5,
341 cmdargs >= 0.10.6,
342 configurator >= 0.2,
343 directory >= 1.2,
344 filepath >= 1.3,
345 hslogger >= 1.2,
346 htsn-common >= 0.0.1,
347 hxt >= 9.3,
348 generics-sop >= 0.1,
349 groundhog >= 0.5,
350 groundhog-postgresql >= 0.5,
351 groundhog-sqlite >= 0.5,
352 groundhog-th >= 0.5,
353 MissingH >= 1.2,
354 old-locale >= 1,
355 split >= 0.2,
356 tasty >= 0.8,
357 tasty-hunit >= 0.8,
358 time >= 1.4,
359 transformers >= 0.3,
360 tuple >= 0.2
361
362 -- It's not entirely clear to me why I have to reproduce all of this.
363 ghc-options:
364 -Wall
365 -fcontext-stack=50
366 -fwarn-hi-shadowing
367 -fwarn-missing-signatures
368 -fwarn-name-shadowing
369 -fwarn-orphans
370 -fwarn-type-defaults
371 -fwarn-tabs
372 -fwarn-incomplete-record-updates
373 -fwarn-monomorphism-restriction
374 -fwarn-unused-do-bind
375 -O2
376
377
378 test-suite doctests
379 type: exitcode-stdio-1.0
380 hs-source-dirs: test
381 main-is: Doctests.hs
382 build-depends:
383 base >= 4.6 && < 5,
384 -- Additional test dependencies.
385 doctest >= 0.9
386
387 -- It's not entirely clear to me why I have to reproduce all of this.
388 ghc-options:
389 -Wall
390 -fcontext-stack=50
391 -fwarn-hi-shadowing
392 -fwarn-missing-signatures
393 -fwarn-name-shadowing
394 -fwarn-orphans
395 -fwarn-type-defaults
396 -fwarn-tabs
397 -fwarn-incomplete-record-updates
398 -fwarn-monomorphism-restriction
399 -fwarn-unused-do-bind
400 -rtsopts
401 -threaded
402 -optc-O3
403 -optc-march=native
404 -O2
405
406
407 -- These won't work without shelltestrunner installed in your
408 -- $PATH. Maybe there is some way to tell Cabal that.
409 test-suite shelltests
410 type: exitcode-stdio-1.0
411 hs-source-dirs: test
412 main-is: ShellTests.hs
413
414 build-depends:
415 base >= 4.6 && < 5,
416 cmdargs >= 0.10.6,
417 configurator >= 0.2,
418 directory >= 1.2,
419 filepath >= 1.3,
420 generics-sop >= 0.1,
421 hslogger >= 1.2,
422 htsn-common >= 0.0.1,
423 hxt >= 9.3,
424 groundhog >= 0.5,
425 groundhog-postgresql >= 0.5,
426 groundhog-sqlite >= 0.5,
427 groundhog-th >= 0.5,
428 MissingH >= 1.2,
429 old-locale >= 1,
430 split >= 0.2,
431 process >= 1.1,
432 tasty >= 0.8,
433 tasty-hunit >= 0.8,
434 time >= 1.4,
435 transformers >= 0.3,
436 tuple >= 0.2
437
438
439
440 source-repository head
441 type: git
442 location: http://michael.orlitzky.com/git/htsn-import.git
443 branch: master