]> gitweb.michael.orlitzky.com - dead/htsn-import.git/blob - htsn-import.cabal
Load TSN.XML.AutoRacingResults in the .ghci file.
[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 tasty >= 0.8,
91 tasty-hunit >= 0.8,
92 time >= 1.4,
93 transformers >= 0.3,
94 tuple >= 0.2
95
96 main-is:
97 Main.hs
98
99 hs-source-dirs:
100 src/
101
102 other-modules:
103 Backend
104 CommandLine
105 Configuration
106 ConnectionString
107 ExitCodes
108 OptionalConfiguration
109 TSN.Codegen
110 TSN.Database
111 TSN.DbImport
112 TSN.Parse
113 TSN.Picklers
114 TSN.XmlImport
115 TSN.XML.AutoRacingResults
116 TSN.XML.AutoRacingSchedule
117 TSN.XML.GameInfo
118 TSN.XML.Heartbeat
119 TSN.XML.Injuries
120 TSN.XML.InjuriesDetail
121 TSN.XML.News
122 TSN.XML.Odds
123 TSN.XML.Scores
124 TSN.XML.SportInfo
125 TSN.XML.Weather
126 Xml
127
128 ghc-options:
129 -Wall
130 -fwarn-hi-shadowing
131 -fwarn-missing-signatures
132 -fwarn-name-shadowing
133 -fwarn-orphans
134 -fwarn-type-defaults
135 -fwarn-tabs
136 -fwarn-incomplete-record-updates
137 -fwarn-monomorphism-restriction
138 -fwarn-unused-do-bind
139 -O2
140
141 ghc-prof-options:
142 -prof
143 -fprof-auto
144 -fprof-cafs
145 -- The following unbreak profiling with template haskell. We have
146 -- to build the program twice; once without profile and again with
147 -- these flags.
148 -hisuf hi_p
149 -osuf o_p
150
151
152 test-suite testsuite
153 type: exitcode-stdio-1.0
154 hs-source-dirs: src test
155 main-is: TestSuite.hs
156 build-depends:
157 base >= 4.6 && < 5,
158 cmdargs >= 0.10.6,
159 configurator >= 0.2,
160 directory >= 1.2,
161 filepath >= 1.3,
162 hslogger >= 1.2,
163 htsn-common >= 0.0.1,
164 hxt >= 9.3,
165 groundhog >= 0.5,
166 groundhog-postgresql >= 0.5,
167 groundhog-sqlite >= 0.5,
168 groundhog-th >= 0.5,
169 MissingH >= 1.2,
170 old-locale >= 1,
171 tasty >= 0.8,
172 tasty-hunit >= 0.8,
173 time >= 1.4,
174 transformers >= 0.3,
175 tuple >= 0.2
176
177 -- It's not entirely clear to me why I have to reproduce all of this.
178 ghc-options:
179 -Wall
180 -fwarn-hi-shadowing
181 -fwarn-missing-signatures
182 -fwarn-name-shadowing
183 -fwarn-orphans
184 -fwarn-type-defaults
185 -fwarn-tabs
186 -fwarn-incomplete-record-updates
187 -fwarn-monomorphism-restriction
188 -fwarn-unused-do-bind
189 -O2
190
191
192 test-suite doctests
193 type: exitcode-stdio-1.0
194 hs-source-dirs: test
195 main-is: Doctests.hs
196 build-depends:
197 base >= 4.6 && < 5,
198 -- Additional test dependencies.
199 doctest >= 0.9
200
201 -- It's not entirely clear to me why I have to reproduce all of this.
202 ghc-options:
203 -Wall
204 -fwarn-hi-shadowing
205 -fwarn-missing-signatures
206 -fwarn-name-shadowing
207 -fwarn-orphans
208 -fwarn-type-defaults
209 -fwarn-tabs
210 -fwarn-incomplete-record-updates
211 -fwarn-monomorphism-restriction
212 -fwarn-unused-do-bind
213 -rtsopts
214 -threaded
215 -optc-O3
216 -optc-march=native
217 -O2
218
219
220 -- These won't work without shelltestrunner installed in your
221 -- $PATH. Maybe there is some way to tell Cabal that.
222 test-suite shelltests
223 type: exitcode-stdio-1.0
224 hs-source-dirs: test
225 main-is: ShellTests.hs
226
227 build-depends:
228 base >= 4.6 && < 5,
229 cmdargs >= 0.10.6,
230 configurator >= 0.2,
231 directory >= 1.2,
232 filepath >= 1.3,
233 hslogger >= 1.2,
234 htsn-common >= 0.0.1,
235 hxt >= 9.3,
236 groundhog >= 0.5,
237 groundhog-postgresql >= 0.5,
238 groundhog-sqlite >= 0.5,
239 groundhog-th >= 0.5,
240 MissingH >= 1.2,
241 old-locale >= 1,
242 process >= 1.1,
243 tasty >= 0.8,
244 tasty-hunit >= 0.8,
245 time >= 1.4,
246 transformers >= 0.3,
247 tuple >= 0.2
248
249
250
251 source-repository head
252 type: git
253 location: http://michael.orlitzky.com/git/htsn-import.git
254 branch: master