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