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