zcc 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +16 -0
- data/Manifest.txt +4 -4
- data/Rakefile +1 -1
- data/bin/zcc +352 -228
- data/examples/zcc.yaml +62 -34
- data/examples/zebra/accessfile +1 -0
- data/examples/zebra/records/0.xml +1 -0
- data/examples/zebra/shadow/remove_me +1 -0
- data/examples/zebra/tab/bib1.att +9 -56
- data/examples/zebra/tab/record.abs +215 -44
- data/examples/zebra/zcc_passw +1 -0
- data/examples/zebra/zebra.cfg +20 -15
- data/lib/zcc/cli_display.rb +64 -42
- data/lib/zcc/query.rb +30 -27
- data/lib/zcc/record.rb +38 -3
- data/lib/zcc/resultset.rb +1 -0
- data/lib/zcc/version.rb +1 -1
- data/website/index.html +7 -5
- data/website/index.txt +2 -2
- data/website/koha.html +32 -19
- data/website/koha.txt +3 -3
- data/website/stylesheets/screen.css +2 -2
- data/website/zcc.html +86 -34
- data/website/zcc.txt +49 -28
- data/website/zebra.html +15 -46
- data/website/zebra.txt +11 -47
- metadata +8 -8
- data/examples/zebra/records/0.mrc +0 -1
- data/examples/zebra/tab/marc21.abs +0 -67
- data/lib/zcc/subfieldeditor.rb +0 -70
- data/lib/zcc/zoomer.rb +0 -86
data/website/koha.txt
CHANGED
@@ -10,11 +10,11 @@ h2. Hints
|
|
10
10
|
|
11
11
|
# "zcc":wzcc only creates utf-8 encoded records. If you want MARC-8 encoded records you're on your own. MARC-8 encoding has already caused enough problems in this world, so I encourage folks to move to UTF-8 ASAP. If you use a different encoding that you want supported, please let me know. To set up Koha properly for dealing with UTF-8 encoded records see "this wiki page":http://wiki.koha.org/doku.php?id=encodingscratchpad&s=utf8
|
12
12
|
|
13
|
-
# ZCC currently only works with a default install as paths are hardcoded. If there's a need I'll make it configurable for someone. Make sure the Koha modules are a part of your path. I accomplish this by adding "export PERL5LIB=/usr/local/koha/intranet/modules" and "export KOHA_CONF=/etc/koha.conf" without the quotes to my .bashrc (or add the path to /etc/profile for the root user). If your paths differ from the preceding saving to Koha will not work.
|
13
|
+
# ZCC currently only works with a default install of Koha as paths are hardcoded. If there's a need I'll make it configurable for someone. Make sure the Koha modules are a part of your path. I accomplish this by adding "export PERL5LIB=/usr/local/koha/intranet/modules" (and "export KOHA_CONF=/etc/koha.conf"?) without the quotes to my .bashrc (or add the path to /etc/profile for the root user). If your paths differ from the preceding saving to Koha will not work.
|
14
14
|
|
15
|
-
# You
|
15
|
+
# You then have 3 choices on how to get the records into koha:
|
16
16
|
|
17
|
-
* Using the Koha Administration interface you can "Upload MARC records to the resevoir." Then complete processing on the records like adding items and barcodes within the Koha web interface. The resevoir may strip out some fields that usually hold local content.
|
17
|
+
* Use ZCC to save_record_syntax your MARC records to file as 'marc'. Using the Koha Administration interface you can "Upload MARC records to the resevoir." Then complete processing on the records like adding items and barcodes within the Koha web interface. The resevoir may strip out some fields that usually hold local content.
|
18
18
|
|
19
19
|
* If you have processed your records fully to include item numbers and barcodes, you can use the bulkmarcimport script to put the records directly into your database. I've used bulkmarcimport without modification without problem. You may have different results and I'd like to hear them.
|
20
20
|
|
@@ -12,7 +12,7 @@ h1, h2, h3, h4, h5, h6 {
|
|
12
12
|
h1 {
|
13
13
|
font-family: sans-serif;
|
14
14
|
font-weight: normal;
|
15
|
-
font-size:
|
15
|
+
font-size: 2em;
|
16
16
|
line-height: 0.8em;
|
17
17
|
letter-spacing: -0.1ex;
|
18
18
|
margin: 5px;
|
@@ -111,7 +111,7 @@ pre, code {
|
|
111
111
|
|
112
112
|
#version .numbers {
|
113
113
|
display: block;
|
114
|
-
font-size:
|
114
|
+
font-size: 3em;
|
115
115
|
line-height: 0.8em;
|
116
116
|
letter-spacing: -0.1ex;
|
117
117
|
margin-bottom: 15px;
|
data/website/zcc.html
CHANGED
@@ -33,39 +33,44 @@
|
|
33
33
|
<h1>zcc</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/zcc"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/zcc" class="numbers">0.2.0</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘zcc’</h1>
|
39
39
|
|
40
|
+
|
40
41
|
<h2>What</h2>
|
41
42
|
|
42
|
-
<p>Z Copy Cataloging is a command line tool written in Ruby to make your <span class="caps">MARC</span> record copy cataloging faster and more accurate. The ‘Z’ may stand for Zippy if you really want it to.</p>
|
43
43
|
|
44
|
+
<p>Z Copy Cataloging is a command line tool written in Ruby to make your <span class="caps">MARC</span> record copy cataloging faster and more accurate. The ‘Z’ may stand for zippy if you really want it to.</p>
|
45
|
+
|
46
|
+
|
47
|
+
<h1><strong><span class="caps">THIS IS</span> beta <span class="caps">SOFTWARE</span>. IT <span class="caps">MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG</span>.</strong>
|
48
|
+
I call it beta because I care about your data.</h1>
|
44
49
|
|
45
|
-
<h1><strong>THIS IS <em>alpha</em> SOFTWARE. <span class="caps">IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG</span>.</strong></h1>
|
46
50
|
|
47
51
|
<h2>Requirements</h2>
|
48
52
|
|
53
|
+
|
49
54
|
<p><a href="http://ruby-lang.org/">Ruby</a> 1.8</p>
|
50
55
|
|
51
56
|
|
52
|
-
<p><a href="http://www.indexdata.dk/yaz/">YAZ</a> I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. <del>From a footnote to ruby-zoom: If you build from source, make sure you pass the—enable-shared option to the configure script before building <span class="caps">YAZ</span>, by default it does not build shared libraries required by Ruby/ZOOM.</del></p>
|
57
|
+
<p><a href="http://www.indexdata.dk/yaz/"><span class="caps">YAZ</span></a> I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. <del>From a footnote to ruby-zoom: If you build from source, make sure you pass the—enable-shared option to the configure script before building <span class="caps">YAZ</span>, by default it does not build shared libraries required by Ruby/ZOOM.</del></p>
|
53
58
|
|
54
59
|
|
55
60
|
<h3>Gems</h3>
|
56
61
|
|
57
|
-
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline term-ansicolor</pre>
|
58
|
-
<p><a href="http://www.textualize.com/ruby_marc">ruby-marc</a></p>
|
59
62
|
|
63
|
+
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline term-ansicolor</pre>
|
60
64
|
|
61
65
|
<p>Linux? <span class="caps">ZCC</span> has only been tested on Linux (Debian Etch). It probably won’t work under other operating systems, but hopefully works with different distros. Feedback is appreciated on how it functions under other operating systems. I’m willing to try to make it work if there is enough interest.</p>
|
62
66
|
|
63
67
|
|
64
|
-
<p>The gems bin folder must be added to your <span class="caps">PATH</span>. For me it is /var/lib/gems/1.8/bin</p>
|
68
|
+
<p>The gems bin folder must be added to your <span class="caps">PATH</span>. For me it is /var/lib/gems/1.8/bin or /usr/bin</p>
|
65
69
|
|
66
70
|
|
67
71
|
<h2>Repository</h2>
|
68
72
|
|
73
|
+
|
69
74
|
<p>A new gem is super easy to release to rubyforge, so expect that the gem on rubyforge is up-to-date for working features, though not necessarily for small changes. If you want to build the gem yourself, it will also be super easy once you set things up.</p>
|
70
75
|
|
71
76
|
|
@@ -73,10 +78,12 @@
|
|
73
78
|
|
74
79
|
|
75
80
|
<pre syntax="ruby">$ sudo gem install newgem --include-dependencies</pre>
|
81
|
+
|
76
82
|
<p>Grab the latest from the svn repository:</p>
|
77
83
|
|
78
84
|
|
79
|
-
<pre syntax="ruby">$ svn
|
85
|
+
<pre syntax="ruby">$ svn checkout svn://rubyforge.org/var/svn/zcc/zcc/trunk</pre>
|
86
|
+
|
80
87
|
<p>To build and install the gem as a user most easily, the user must be added to the sudoers list. On my system I do this by running visudo as root. For more information on sudoers and possible settings that may be more secure consult: <a href="http://www.gratisoft.us/sudo/man/sudoers.html">Sudoers Manual</a></p>
|
81
88
|
|
82
89
|
|
@@ -85,48 +92,66 @@
|
|
85
92
|
|
86
93
|
<pre syntax="ruby">Cmnd_Alias GEM=/usr/bin/gem
|
87
94
|
user ALL=GEM</pre>
|
95
|
+
|
88
96
|
<p>Now as a user you can build and install the gem on your own system:</p>
|
89
97
|
|
90
98
|
|
91
99
|
<pre syntax="ruby">$ cd zcc
|
92
100
|
$ rake local_deploy</pre>
|
101
|
+
|
102
|
+
<p>or just</p>
|
103
|
+
|
104
|
+
|
105
|
+
<pre syntax="ruby"> $ rake install_gem</pre>
|
106
|
+
|
93
107
|
<p>For more tasks take a look at the output of:</p>
|
94
108
|
|
95
109
|
|
96
110
|
<pre syntax="ruby">$ rake -T </pre>
|
111
|
+
|
97
112
|
<h2>Features</h2>
|
98
113
|
|
99
|
-
<p><strong>Z39.50 search for records.</strong> Configure <span class="caps">ZCC</span> for as many targets as you like grouped in order of preference. A relatively current list of targets is provided based on the targettest list (examples/zservers.yaml). If you find the perfect record with the first target other targets do not have to be searched.</p>
|
100
114
|
|
115
|
+
<p><strong><span class="caps">Z39</span>.50 search for records.</strong> Configure <span class="caps">ZCC</span> for as many targets as you like grouped in order of preference. A relatively current list of targets is provided in proper yaml format based on the <a href="http://targettest.indexdata.com/">targettest list</a> (see examples/zservers.yaml). Searches are grouped so if you find the perfect record with the first batch of targets other targets do not have to be searched. Include your preferred zservers in a lower group to get better quality records faster.</p>
|
101
116
|
|
102
|
-
<p><strong>Search by Title, <span class="caps">ISBN</span> or <span class="caps">LCCN</span></strong> Currently three searches are supported. From the same prompt you may search either by Title, <span class="caps">ISBN</span> or <span class="caps">LCCN</span> (with dash).</p>
|
103
117
|
|
118
|
+
<p><strong>Search by Title, <span class="caps">ISBN</span> or <span class="caps">LCCN</span></strong> Currently three searches are supported. From the same prompt you may search either by Title, <span class="caps">ISBN</span> (no dashes) or <span class="caps">LCCN</span> (with dash).</p>
|
104
119
|
|
105
|
-
<p><strong>Sort your result sets by relevancy (title search only), date, content (AACR, <span class="caps">ISBD</span>), or any chosen subfield (first instance only).</p>
|
106
120
|
|
121
|
+
<p><strong>Sort your result sets by relevancy (title search only and on by default), date, content (AACR, <span class="caps">ISBD</span>), or any chosen subfield (first instance only).</p>
|
107
122
|
|
108
|
-
<p></strong>See the most important fields for copy cataloging when choosing correct records.* In the initial list view <span class="caps">ZCC</span> presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release.</p>
|
109
123
|
|
124
|
+
<p></strong>See the most important fields for copy cataloging when choosing correct records.* In the initial list view <span class="caps">ZCC</span> presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release so you may include whatever</p>
|
110
125
|
|
111
|
-
<p><strong>View the full <span class="caps">MARC</span> record before choosing.</strong> ZCC allows you to see the full <span class="caps">MARC</span> record in a pretty line format. <span class="caps">ZCC</span> does not hide <span class="caps">MARC</span> from you, even as ugly as it can be.</p>
|
112
126
|
|
127
|
+
<p><strong>View the full <span class="caps">MARC</span> record before choosing.</strong> ZCC allows you to see the full <span class="caps">MARC</span> record in a pretty line format. <span class="caps">ZCC</span> does not hide <span class="caps">MARC</span> from you, even as ugly as it can be. If there’s only one record in your result set then you see the full record.</p>
|
113
128
|
|
114
|
-
|
129
|
+
|
130
|
+
<p><strong>Compare two records and choose the best.</strong> ZCC compares field by field (ie line by line) for matched fields. You can quickly see what fields come from which record. The comparison is similar to the way diff works. Matches between records are denoted with an ‘m’ while one record is denoted with a plus-sign and the other with a minus-sign. <span class="caps">TODO</span>: improvements would allow for color coding differences.</p>
|
115
131
|
|
116
132
|
|
117
133
|
<p><strong>Optional: Check the record for common errors.</strong> If you have Perl’s <span class="caps">MARC</span>::Lint installed you can see if all your indicators have proper values and only repeatable fields repeat. An added feature is determining what encoding level (ISBD, <span class="caps">AACR2</span>) the record is in.</p>
|
118
134
|
|
119
135
|
|
120
|
-
<p><strong>Choose records from different targets and then choose among them to find the best record.</strong> In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.</p>
|
136
|
+
<p><strong>Choose records from different targets and then choose among them to find the best record.</strong> In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. This is called the winnowing stage. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on. Choose all the records, none of them or just one for processing.</p>
|
137
|
+
|
138
|
+
|
139
|
+
<p><strong>Scripted changes to records.</strong> ZCC is highly configurable for making scripted changes to each record like macros. Want to delete all 852 or 9XX fields from a record before importing into your library system? <span class="caps">ZCC</span> can do that and more. Add fields and subfields with pre-determined information or prompt for information. With version 0.2.0 you can now set up more than one scripting profile and choose which profile to use on a per record basis. The ‘start’ and ‘end’ scripts run before and after the script you choose. The previous examples are easy to configure. With a little Ruby scripting you can make more complex changes. A few sample scripts are provided that do things like take the dewey call number from the 082a field and copy it to the fields Koha uses for call numbers, and if there is no 082a field it prompts for the proper call number parts. Don’t need scripting? Just turn it off. Need a script that isn’t available and you don’t know any Ruby—let know and we’ll see if we can work something out. <span class="caps">TODO</span>: Put each script in a separate file in a ‘scripts’ directory under the <span class="caps">ZCC</span> root directory. Make writing plugins in Ruby easier.</p>
|
140
|
+
|
141
|
+
|
142
|
+
<p><strong>Output to <span class="caps">CSV</span> file.</strong> Want to print labels or keep statistics? <span class="caps">ZCC</span> allows you to choose which subfields you would like to export into a <span class="caps">CSV</span> file. Programs like glabels can accept <span class="caps">CSV</span> files for custom labelmaking. <span class="caps">CSV</span> files can also be imported into spreadsheet programs like OpenOffice Calc or Excel. (If a value is not found for a particular field <span class="caps">ZCC</span> will prompt the user for input, which can be blank. I’m considering turning off this feature.)</p>
|
121
143
|
|
122
144
|
|
123
|
-
<p><strong>
|
145
|
+
<p><strong>Subfield editing</strong> Since version 0.0.3 there is a facility for editing subfields. Have you found a good record but one or two subfields are different than the item you have in hand? You can still accept the record and make small edits of existing subfields. It allows you to pick the subfield you want to edit when there are repeatable fields and subfields. Not a replacement for a <span class="caps">MARC</span> editor, but for copy cataloging probably good enough in many cases. Still lacking some features like timestamp change.</p>
|
124
146
|
|
125
147
|
|
126
|
-
<p><strong>
|
148
|
+
<p><strong>Full record editing</strong> Version 0.2.0 now has a full <span class="caps">MARC</span> editor. Well, sort of. <span class="caps">ZCC</span> uses yaz-marcdump to turn the file into line format. It then opens up this line formatted record in your favorite editor (vim by default). Once you edit the record and save it, yaz-marcdump translates the record from line format back into <span class="caps">MARC</span> format.</p>
|
127
149
|
|
128
150
|
|
129
|
-
<p><strong>
|
151
|
+
<p><strong>Independent features</strong> You may turn on or off particular features. Don’t want your copy catalogers to do more than minimal editing? Turn off the full record editing and only allow subfield editing.</p>
|
152
|
+
|
153
|
+
|
154
|
+
<p><strong>Update zebra records</strong> You can now use <span class="caps">ZCC</span> to update records that are already in your database. The 901$a field is a reserved field for <span class="caps">ZCC</span> so selecting a record from your own database, editing it and saving it again will match on that field and update the record with the edited version. You’ll probably want to select ‘none’ if you have scripting turned on, or you may want to have a yaml config file just for editing records that are already in your zebra database. <span class="caps">TODO</span>: Allow the recordID field to be configurable.</p>
|
130
155
|
|
131
156
|
|
132
157
|
<p>Sample simple <strong>zebra</strong> set up to enable a localhost. See: <a href="http://zcc.rubyforge.org/zebra.html">Very simple setup of local zebra server</a></p>
|
@@ -134,35 +159,53 @@ $ rake local_deploy</pre>
|
|
134
159
|
|
135
160
|
<h2>Configuration</h2>
|
136
161
|
|
137
|
-
|
162
|
+
|
163
|
+
<p>Because of all the scripting and csv features zcc requires a lot of configuration to get exactly what you want out of it. Currently the configuration files are my own. I use them and they work for my purposes, but they will not work for yours. Once you have configured zcc, though, you should be copy cataloging much faster.</p>
|
138
164
|
|
139
165
|
|
140
|
-
<p>
|
166
|
+
<p>An example zcc.yaml config file can be found in the examples directory of the gem. For instance if in your home directory you have a directory .zcc for all <span class="caps">ZCC</span> related configuration then:</p>
|
141
167
|
|
142
168
|
|
143
169
|
<pre syntax="ruby">cd ~/.zcc
|
144
|
-
cp -r /var/lib/gems/1.8/gems/zcc-0.0
|
170
|
+
cp -r /var/lib/gems/1.8/gems/zcc-0.2.0/examples/* .</pre>
|
171
|
+
|
172
|
+
Or if use Debian and you’ve updated rubygems to use a version other than the one in apt you might find it here:
|
173
|
+
<pre syntax="ruby">cp -r /usr/lib/ruby/gems/1.8/gems/zcc-0.2.0/examples/* .</pre>
|
174
|
+
|
175
|
+
<p>Edit the file zcc.yaml to your liking. <span class="caps">YOU MUST AT LEAST CHANGE THE ROOT DIRECTORY</span>. Detailed instructions are given in this file to aid in configuration. It refers you to some other configuration files for optional added configuration.</p>
|
176
|
+
|
177
|
+
|
145
178
|
<p>Now if you want your retrieved records to be indexed and searchable over <span class="caps">Z39</span>.50 via zebra check out this quick start page: <a href="http://zcc.rubyforge.org/zebra.html">Very simple setup of local zebra server</a></p>
|
146
179
|
|
147
180
|
|
148
181
|
<h2>Use</h2>
|
149
182
|
|
150
|
-
|
183
|
+
|
184
|
+
<p>If zcc.yaml is in the working directory:
|
185
|
+
$ zcc</p>
|
186
|
+
|
187
|
+
|
188
|
+
<p>If your yaml configuration file is in a different directory do something like:
|
189
|
+
$ zcc —yaml ~/.zcc/zcc.yaml
|
190
|
+
or
|
191
|
+
$ zcc -y /path/to/zcc_config.yaml
|
192
|
+
So your <span class="caps">ZCC</span> yaml configuration file can have a different name if the —yaml (-y) switch is used. It may also be placed in a different directory from the rest of your <span class="caps">ZCC</span> configuration and working files. You may wish to have multiple configuration files for different needs.</p>
|
151
193
|
|
152
194
|
|
153
|
-
<ol>
|
154
|
-
<li>Configure both ~/.zcc/zcc.yaml.</li>
|
195
|
+
<ol>
|
155
196
|
<li>From the command line run zcc</li>
|
156
|
-
|
157
|
-
|
158
|
-
</ol>
|
197
|
+
<li>Next to each shown result is a number. Numbering starts with zero. </li>
|
198
|
+
<li><span class="caps">ZCC</span> command line: type ‘help’ to see the possible help options.</li>
|
199
|
+
</ol>
|
200
|
+
|
201
|
+
|
202
|
+
<h2><span class="caps">TODO</span></h2>
|
159
203
|
|
160
|
-
<h2>TODO</h2>
|
161
204
|
|
162
205
|
<p><del><strong>Smart character set conversion</strong> Currently incoming records are assumed to be marc8 and are converted to utf8. This is complex. Let me know what you need here.</del> v. 0.0.3+ checks leader byte 9 for character encoding and either keeps it as <span class="caps">UTF8</span> or convert from <span class="caps">MARC8</span> to <span class="caps">UTF8</span>. Uses ruby-zoom’s xml method for conversion.</p>
|
163
206
|
|
164
207
|
|
165
|
-
<p><strong>TUI</strong> <del>If there is interest in this script, I’m hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer <span class="caps">TUI</span> elements like highlighting</del> With version 0.1.0, there’s a much nicer configurable <span class="caps">TUI</span
|
208
|
+
<p><strong><span class="caps">TUI</span></strong> <del>If there is interest in this script, I’m hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer <span class="caps">TUI</span> elements like highlighting</del> With version 0.1.0, there’s a much nicer configurable <span class="caps">TUI</span> which uses highline and ansicolor gems.</p>
|
166
209
|
|
167
210
|
|
168
211
|
<p><strong>Automatic retrieval of authority records.</strong> I already have a separate script in the works that can retrieve authority records for names (not subjects). I’d like to work that as an option into the main script.</p>
|
@@ -171,33 +214,39 @@ cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
|
|
171
214
|
<p><strong>Unit Testing.</strong> While I’ve tested the script in my own work, I need to do more formal testing of the methods.</p>
|
172
215
|
|
173
216
|
|
174
|
-
<p><strong>Exception handling.</strong> Currently there’s not great exception handling in the script. This needs to change, but hasn’t caused problems for me yet.</p>
|
217
|
+
<p><strong>Exception handling.</strong> Currently there’s not great exception handling for all potential errors that may arise in the script. This needs to change, but hasn’t caused problems for me yet.</p>
|
218
|
+
|
175
219
|
|
220
|
+
<p><strong>Internationalize</strong> <del>This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user’s prefered <span class="caps">MARC</span> flavor.</del> You now have the choice of which fields display by default. If there is interest, I’d be willing to try making other text translatable.</p>
|
176
221
|
|
177
|
-
<p><strong>Internationalize</strong> <del>This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user’s prefered <span class="caps">MARC</span> flavor.</del> If there is interest, I’d be willing to try making other text translatable.</p>
|
178
222
|
|
223
|
+
<p><strong>Turn off/on displayed fields/subfields</strong></p>
|
179
224
|
|
180
|
-
|
225
|
+
|
226
|
+
<p><del>Move all configuration to <span class="caps">YAML</span> file. Currently some configuration is made in the main script and some in the <span class="caps">YAML</span> file.</del> As of version 0.2.0, the yaml file is getting quite long so I’m looking at ways to break out long configuration files like zservers.yaml and scripts while still allowing everything to be self-contained in one file if that is the desire.</p>
|
181
227
|
|
182
228
|
|
183
229
|
<p>Create full <strong>rdoc documentation</strong>.</p>
|
184
230
|
|
185
231
|
|
186
|
-
<p><strong>
|
232
|
+
<p><strong>Editing</strong> has been added now as two modules: simple subfield editing or full record editing. Still to do: Change the timestamp automatically and allow for adding subfields like 040d upon modification.</p>
|
187
233
|
|
188
234
|
|
189
235
|
<h2>Suggestions</h2>
|
190
236
|
|
237
|
+
|
191
238
|
<p>Perl and <span class="caps">MARC</span>::Lint To have error checking of records turned on you must also have Perl and <span class="caps">MARC</span>::Lint installed.</p>
|
192
239
|
|
193
240
|
|
194
241
|
<h2>Using Koha with zcc</h2>
|
195
242
|
|
196
|
-
|
243
|
+
|
244
|
+
<p><span class="caps">ZCC</span> can now use Koha2’s bulkmarcimport script to insert records directly into the Koha database. For more information see this page: <a href="http://zcc.rubyforge.org/koha.html">using Koha with zcc</a></p>
|
197
245
|
|
198
246
|
|
199
247
|
<h2>Help/paches</h2>
|
200
248
|
|
249
|
+
|
201
250
|
<p>email: <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a></p>
|
202
251
|
|
203
252
|
|
@@ -206,11 +255,13 @@ cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
|
|
206
255
|
|
207
256
|
<h2>Will work for Ruby books</h2>
|
208
257
|
|
258
|
+
|
209
259
|
<p>If you’d like to sponsor the addition of a feature to <span class="caps">ZCC</span> or need a change to better meet your workflow, I will work for Ruby books. Up to now I’ve, requested Programming Ruby, Ruby Cookbook, Agile Web Development with Rails and others from libraries via Inter-Library Loan. I never get to keep them as long as I’d like. I’d like to have my own copies of these invaluable resources.</p>
|
210
260
|
|
211
261
|
|
212
262
|
<h2>License</h2>
|
213
263
|
|
264
|
+
|
214
265
|
<p>Copyright© 2007 Jason Ronallo</p>
|
215
266
|
|
216
267
|
|
@@ -225,6 +276,7 @@ cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
|
|
225
276
|
|
226
277
|
<h2>Contact</h2>
|
227
278
|
|
279
|
+
|
228
280
|
<p>Comments are welcome. Send an email to <a href="mailto:jronallo+zcc@gmail.com">Jason Ronallo</a>.</p>
|
229
281
|
|
230
282
|
</div>
|
data/website/zcc.txt
CHANGED
@@ -4,9 +4,10 @@ h1. → 'zcc'
|
|
4
4
|
|
5
5
|
h2. What
|
6
6
|
|
7
|
-
Z Copy Cataloging is a command line tool written in Ruby to make your MARC record copy cataloging faster and more accurate. The 'Z' may stand for
|
7
|
+
Z Copy Cataloging is a command line tool written in Ruby to make your MARC record copy cataloging faster and more accurate. The 'Z' may stand for zippy if you really want it to.
|
8
8
|
|
9
|
-
h1. *THIS IS
|
9
|
+
h1. *THIS IS beta SOFTWARE. IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG.*
|
10
|
+
I call it beta because I care about your data.
|
10
11
|
|
11
12
|
h2. Requirements
|
12
13
|
|
@@ -18,11 +19,9 @@ h3. Gems
|
|
18
19
|
|
19
20
|
<pre syntax="ruby">sudo gem install zcc marc zoom unicode highline term-ansicolor</pre>
|
20
21
|
|
21
|
-
"ruby-marc":http://www.textualize.com/ruby_marc
|
22
|
-
|
23
22
|
Linux? ZCC has only been tested on Linux (Debian Etch). It probably won't work under other operating systems, but hopefully works with different distros. Feedback is appreciated on how it functions under other operating systems. I'm willing to try to make it work if there is enough interest.
|
24
23
|
|
25
|
-
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8/bin
|
24
|
+
The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8/bin or /usr/bin
|
26
25
|
|
27
26
|
|
28
27
|
h2. Repository
|
@@ -35,7 +34,7 @@ To make sure you have all the dependencies needed to build the gem:
|
|
35
34
|
|
36
35
|
Grab the latest from the svn repository:
|
37
36
|
|
38
|
-
<pre syntax="ruby">$ svn
|
37
|
+
<pre syntax="ruby">$ svn checkout svn://rubyforge.org/var/svn/zcc/zcc/trunk</pre>
|
39
38
|
|
40
39
|
To build and install the gem as a user most easily, the user must be added to the sudoers list. On my system I do this by running visudo as root. For more information on sudoers and possible settings that may be more secure consult: "Sudoers Manual":http://www.gratisoft.us/sudo/man/sudoers.html
|
41
40
|
|
@@ -49,6 +48,10 @@ Now as a user you can build and install the gem on your own system:
|
|
49
48
|
<pre syntax="ruby">$ cd zcc
|
50
49
|
$ rake local_deploy</pre>
|
51
50
|
|
51
|
+
or just
|
52
|
+
|
53
|
+
<pre syntax="ruby"> $ rake install_gem</pre>
|
54
|
+
|
52
55
|
For more tasks take a look at the output of:
|
53
56
|
|
54
57
|
<pre syntax="ruby">$ rake -T </pre>
|
@@ -56,47 +59,63 @@ For more tasks take a look at the output of:
|
|
56
59
|
|
57
60
|
h2. Features
|
58
61
|
|
59
|
-
*Z39.50 search for records.* Configure ZCC for as many targets as you like grouped in order of preference. A relatively current list of targets is provided based on the targettest list (examples/zservers.yaml).
|
62
|
+
*Z39.50 search for records.* Configure ZCC for as many targets as you like grouped in order of preference. A relatively current list of targets is provided in proper yaml format based on the "targettest list":http://targettest.indexdata.com/ (see examples/zservers.yaml). Searches are grouped so if you find the perfect record with the first batch of targets other targets do not have to be searched. Include your preferred zservers in a lower group to get better quality records faster.
|
60
63
|
|
61
|
-
*Search by Title, ISBN or LCCN* Currently three searches are supported. From the same prompt you may search either by Title, ISBN or LCCN (with dash).
|
64
|
+
*Search by Title, ISBN or LCCN* Currently three searches are supported. From the same prompt you may search either by Title, ISBN (no dashes) or LCCN (with dash).
|
62
65
|
|
63
|
-
*Sort your result sets by relevancy (title search only), date, content (AACR, ISBD), or any chosen subfield (first instance only).
|
66
|
+
*Sort your result sets by relevancy (title search only and on by default), date, content (AACR, ISBD), or any chosen subfield (first instance only).
|
64
67
|
|
65
|
-
*See the most important fields for copy cataloging when choosing correct records.* In the initial list view ZCC presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release
|
68
|
+
*See the most important fields for copy cataloging when choosing correct records.* In the initial list view ZCC presents the user with the full 245 (title and statement of responsibility) and 300 (extent, which includes page numbers). This gives you a quick way to determine potential records. The fields displayed is configurable as of the 0.1.0 release so you may include whatever
|
66
69
|
|
67
|
-
*View the full MARC record before choosing.* ZCC allows you to see the full MARC record in a pretty line format. ZCC does not hide MARC from you, even as ugly as it can be.
|
70
|
+
*View the full MARC record before choosing.* ZCC allows you to see the full MARC record in a pretty line format. ZCC does not hide MARC from you, even as ugly as it can be. If there's only one record in your result set then you see the full record.
|
68
71
|
|
69
|
-
*Compare two records and choose the best.* ZCC compares field by field (ie line by line) for matched fields. You can quickly see what fields come from which record. The comparison is similar to the way diff works. Matches between records are denoted with an 'm' while one record is denoted with a plus-sign and the other with a minus-sign. TODO:
|
72
|
+
*Compare two records and choose the best.* ZCC compares field by field (ie line by line) for matched fields. You can quickly see what fields come from which record. The comparison is similar to the way diff works. Matches between records are denoted with an 'm' while one record is denoted with a plus-sign and the other with a minus-sign. TODO: improvements would allow for color coding differences.
|
70
73
|
|
71
74
|
*Optional: Check the record for common errors.* If you have Perl's MARC::Lint installed you can see if all your indicators have proper values and only repeatable fields repeat. An added feature is determining what encoding level (ISBD, AACR2) the record is in.
|
72
75
|
|
73
|
-
*Choose records from different targets and then choose among them to find the best record.* In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on.
|
76
|
+
*Choose records from different targets and then choose among them to find the best record.* In the end you may just want one record and you want the best one. All the same features available for each target are also available for all the records chosen from all targets, so users can pick the best record for their location. This is called the winnowing stage. View the full records, compare two records, and optionally lint records. This allows you to choose possible records quickly from various targets and then make a final decision later on. Choose all the records, none of them or just one for processing.
|
77
|
+
|
78
|
+
*Scripted changes to records.* ZCC is highly configurable for making scripted changes to each record like macros. Want to delete all 852 or 9XX fields from a record before importing into your library system? ZCC can do that and more. Add fields and subfields with pre-determined information or prompt for information. With version 0.2.0 you can now set up more than one scripting profile and choose which profile to use on a per record basis. The 'start' and 'end' scripts run before and after the script you choose. The previous examples are easy to configure. With a little Ruby scripting you can make more complex changes. A few sample scripts are provided that do things like take the dewey call number from the 082a field and copy it to the fields Koha uses for call numbers, and if there is no 082a field it prompts for the proper call number parts. Don't need scripting? Just turn it off. Need a script that isn't available and you don't know any Ruby--let know and we'll see if we can work something out. TODO: Put each script in a separate file in a 'scripts' directory under the ZCC root directory. Make writing plugins in Ruby easier.
|
79
|
+
|
80
|
+
*Output to CSV file.* Want to print labels or keep statistics? ZCC allows you to choose which subfields you would like to export into a CSV file. Programs like glabels can accept CSV files for custom labelmaking. CSV files can also be imported into spreadsheet programs like OpenOffice Calc or Excel. (If a value is not found for a particular field ZCC will prompt the user for input, which can be blank. I'm considering turning off this feature.)
|
81
|
+
|
82
|
+
*Subfield editing* Since version 0.0.3 there is a facility for editing subfields. Have you found a good record but one or two subfields are different than the item you have in hand? You can still accept the record and make small edits of existing subfields. It allows you to pick the subfield you want to edit when there are repeatable fields and subfields. Not a replacement for a MARC editor, but for copy cataloging probably good enough in many cases. Still lacking some features like timestamp change.
|
74
83
|
|
75
|
-
*
|
84
|
+
*Full record editing* Version 0.2.0 now has a full MARC editor. Well, sort of. ZCC uses yaz-marcdump to turn the file into line format. It then opens up this line formatted record in your favorite editor (vim by default). Once you edit the record and save it, yaz-marcdump translates the record from line format back into MARC format.
|
76
85
|
|
77
|
-
*
|
86
|
+
*Independent features* You may turn on or off particular features. Don't want your copy catalogers to do more than minimal editing? Turn off the full record editing and only allow subfield editing.
|
78
87
|
|
79
|
-
*
|
88
|
+
*Update zebra records* You can now use ZCC to update records that are already in your database. The 901$a field is a reserved field for ZCC so selecting a record from your own database, editing it and saving it again will match on that field and update the record with the edited version. You'll probably want to select 'none' if you have scripting turned on, or you may want to have a yaml config file just for editing records that are already in your zebra database. TODO: Allow the recordID field to be configurable.
|
80
89
|
|
81
90
|
Sample simple *zebra* set up to enable a localhost. See: "Very simple setup of local zebra server":http://zcc.rubyforge.org/zebra.html
|
82
91
|
|
83
92
|
h2. Configuration
|
84
93
|
|
85
|
-
Because of all the scripting and csv features zcc requires a lot of configuration. Currently the configuration files are my own. I use them and they work for my purposes, but they will not work for yours. Once you have configured zcc, though, you should be copy cataloging much faster.
|
94
|
+
Because of all the scripting and csv features zcc requires a lot of configuration to get exactly what you want out of it. Currently the configuration files are my own. I use them and they work for my purposes, but they will not work for yours. Once you have configured zcc, though, you should be copy cataloging much faster.
|
86
95
|
|
87
|
-
|
88
|
-
All of the configuration (as of 0.0.2) is looked for in the user's home directory in ~/.zcc/zcc.yaml. An example zcc.yaml config file can be found in the examples directory of the gem.
|
96
|
+
An example zcc.yaml config file can be found in the examples directory of the gem. For instance if in your home directory you have a directory .zcc for all ZCC related configuration then:
|
89
97
|
|
90
98
|
<pre syntax="ruby">cd ~/.zcc
|
91
|
-
cp -r /var/lib/gems/1.8/gems/zcc-0.0
|
99
|
+
cp -r /var/lib/gems/1.8/gems/zcc-0.2.0/examples/* .</pre>
|
100
|
+
|
101
|
+
Or if use Debian and you've updated rubygems to use a version other than the one in apt you might find it here:
|
102
|
+
<pre syntax="ruby">cp -r /usr/lib/ruby/gems/1.8/gems/zcc-0.2.0/examples/* .</pre>
|
103
|
+
|
104
|
+
Edit the file zcc.yaml to your liking. YOU MUST AT LEAST CHANGE THE ROOT DIRECTORY. Detailed instructions are given in this file to aid in configuration. It refers you to some other configuration files for optional added configuration.
|
92
105
|
|
93
106
|
Now if you want your retrieved records to be indexed and searchable over Z39.50 via zebra check out this quick start page: "Very simple setup of local zebra server":http://zcc.rubyforge.org/zebra.html
|
94
107
|
|
95
108
|
h2. Use
|
96
109
|
|
97
|
-
|
110
|
+
If zcc.yaml is in the working directory:
|
111
|
+
$ zcc
|
112
|
+
|
113
|
+
If your yaml configuration file is in a different directory do something like:
|
114
|
+
$ zcc --yaml ~/.zcc/zcc.yaml
|
115
|
+
or
|
116
|
+
$ zcc -y /path/to/zcc_config.yaml
|
117
|
+
So your ZCC yaml configuration file can have a different name if the --yaml (-y) switch is used. It may also be placed in a different directory from the rest of your ZCC configuration and working files. You may wish to have multiple configuration files for different needs.
|
98
118
|
|
99
|
-
# Configure both ~/.zcc/zcc.yaml.
|
100
119
|
# From the command line run zcc
|
101
120
|
# Next to each shown result is a number. Numbering starts with zero.
|
102
121
|
# ZCC command line: type 'help' to see the possible help options.
|
@@ -105,21 +124,23 @@ h2. TODO
|
|
105
124
|
|
106
125
|
-*Smart character set conversion* Currently incoming records are assumed to be marc8 and are converted to utf8. This is complex. Let me know what you need here.- v. 0.0.3+ checks leader byte 9 for character encoding and either keeps it as UTF8 or convert from MARC8 to UTF8. Uses ruby-zoom's xml method for conversion.
|
107
126
|
|
108
|
-
*TUI* -If there is interest in this script, I'm hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer TUI elements like highlighting- With version 0.1.0, there's a much nicer configurable TUI.
|
127
|
+
*TUI* -If there is interest in this script, I'm hoping to make a nice Text User Interface with curses or ncurses. Currently everything just scrolls up the terminal. Since v. 0.0.3 there are some nicer TUI elements like highlighting- With version 0.1.0, there's a much nicer configurable TUI which uses highline and ansicolor gems.
|
109
128
|
|
110
129
|
*Automatic retrieval of authority records.* I already have a separate script in the works that can retrieve authority records for names (not subjects). I'd like to work that as an option into the main script.
|
111
130
|
|
112
131
|
*Unit Testing.* While I've tested the script in my own work, I need to do more formal testing of the methods.
|
113
132
|
|
114
|
-
*Exception handling.* Currently there's not great exception handling in the script. This needs to change, but hasn't caused problems for me yet.
|
133
|
+
*Exception handling.* Currently there's not great exception handling for all potential errors that may arise in the script. This needs to change, but hasn't caused problems for me yet.
|
134
|
+
|
135
|
+
*Internationalize* -This can start by not hardcoding any fields and allowing them to be configurable. The initial display of fields on search of a target should show the relevant fields in the user's prefered MARC flavor.- You now have the choice of which fields display by default. If there is interest, I'd be willing to try making other text translatable.
|
115
136
|
|
116
|
-
*
|
137
|
+
*Turn off/on displayed fields/subfields*
|
117
138
|
|
118
|
-
-Move all configuration to YAML file. Currently some configuration is made in the main script and some in the YAML file.-
|
139
|
+
-Move all configuration to YAML file. Currently some configuration is made in the main script and some in the YAML file.- As of version 0.2.0, the yaml file is getting quite long so I'm looking at ways to break out long configuration files like zservers.yaml and scripts while still allowing everything to be self-contained in one file if that is the desire.
|
119
140
|
|
120
141
|
Create full *rdoc documentation*.
|
121
142
|
|
122
|
-
*
|
143
|
+
*Editing* has been added now as two modules: simple subfield editing or full record editing. Still to do: Change the timestamp automatically and allow for adding subfields like 040d upon modification.
|
123
144
|
|
124
145
|
h2. Suggestions
|
125
146
|
|
@@ -127,7 +148,7 @@ Perl and MARC::Lint To have error checking of records turned on you must also ha
|
|
127
148
|
|
128
149
|
h2. Using Koha with zcc
|
129
150
|
|
130
|
-
|
151
|
+
ZCC can now use Koha2's bulkmarcimport script to insert records directly into the Koha database. For more information see this page: "using Koha with zcc":http://zcc.rubyforge.org/koha.html
|
131
152
|
|
132
153
|
h2. Help/paches
|
133
154
|
|