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