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