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