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