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