mixed in enumerable to result set class. added result set method to get the size...
[zcc.git] / website / zcc.txt
blob936c402e7e75f9b00d0d85f49529b8342dba14e0
1 h1. zcc
3 h1. → 'zcc'
5 h2. What
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.
9 h1. *THIS IS _alpha_ SOFTWARE. IT MIGHT MANGLE YOUR MARC AND CORRUPT YOUR CATALOG.*
11 h2. Requirements
13 "Ruby":http://ruby-lang.org/ 1.8
15 "YAZ":http://www.indexdata.dk/yaz/ I suggest adding the indexdata repositories for your distro (Debian or Redhat) and installing that way. -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 YAZ, by default it does not build shared libraries required by Ruby/ZOOM.-
17 h3. Gems
19 <pre syntax="ruby">sudo gem install zcc marc zoom unicode highline</pre>
21 "ruby-marc":http://www.textualize.com/ruby_marc 
23 *nix? Zcc has only been tested on Linux (Debian Etch). It may work under other operating systems. 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. 
25 The gems bin folder must be added to your PATH. For me it is /var/lib/gems/1.8.bin
28 h2. Repository
30 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.
32 To make sure you have all the dependencies needed to build the gem:
34 <pre syntax="ruby">$ sudo gem install newgem --include-dependencies</pre>
36 Grab the latest from the svn repository:
38 <pre syntax="ruby">$ svn co svn://208.78.97.122/zcc</pre>
40 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
42 You can add the following lines using visudo:
44 <pre syntax="ruby">Cmnd_Alias GEM=/usr/bin/gem
45 user     ALL=GEM</pre>
47 Now as a user you can build and install the gem on your own system:
49 <pre syntax="ruby">$ cd zcc
50 $ rake local_deploy</pre>
52 For more tasks take a look at the output of:
54 <pre syntax="ruby">$ rake -T </pre>
57 h2. Features
59 *Z39.50 search for records.* Configure Zcc for as many targets as you like in order of preference. A relatively current list of targets is provided based on the targettest list. If you find the perfect record with the first target other targets do not have to be searched.
61 *Search by Title or ISBN* Currently two searches are supported. From the same prompt you may search either by Title or ISBN. For a search of the Library of Congress you may also search by Library of Congress Card Number.
63 *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. TODO: Make the fields displayed configurable, especially for other MARC flavors.
65 *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.
67 *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: a curses interface may allow for color coding differences.
69 *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.
71 *Choose records from different targets and then choose among them to find the best record.* In the end you 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.
73 *Scripted changes to records.* Zcc is highly configurable for making scripted changes to each record like macros. Want to delete all 900 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. 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 the feature? Just turn it off.
75 *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. 
77 *Light editing of subfields* 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.  
79 Sample simple *zebra* set up to enable a localhost. See: "Very simple setup of local zebra server":http://zcc.rubyforge.org/zebra.html
81 h2. Configuration
83 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.
86 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.
88 <pre syntax="ruby">cd ~/.zcc
89 cp -r /var/lib/gems/1.8/gems/zcc-0.0.4/examples/* .</pre>
91 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
93 h2. Use
95 $ zcc
97 # Configure both ~/.zcc/zcc.yaml.
98 # From the command line run zcc
99 # Enter a title or ISBN to search for.
100 # rset.length is the number of results found in the target. Depending on configuration you may not be presented with all results.
101 # Next to each shown result is a number. Numbering starts with zero. Use that number in the following way:
102 # Zcc command line
104     * Key in a number and hit Enter to select a record into your own set.
105     * Key 's' followed by a number to see the result. For instance 's3' would show you the full MARC for the 3rd record.
106     * To compare two records enter 'c#&#8211;#'. For instance 'c5&#8211;3' would compare record 5 to record 3. Matches are shown with 'm' at the beginning of a line. The first record is denoted with a '+' and the second with a minus sign.
107     * Enter 'n' to go to the next ztarget.
108     * Enter 'd' if you are done selecting records. This will skip the rest of the ztargets.
109     * If you have the linter turned on (and Perl modules instaled) 'l#' will give any USMARC errors such as incorrect indicators for a particular field.
110     * Once you select a final records it goes through scripting and csv creation if those are turned on.
111     * You are then prompted to conduct a new search.
113 h2. TODO
115 -*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
117 *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
119 *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.
121 *Unit Testing.* While I've tested the script in my own work, I need to do more formal testing of the methods.
123 *Exception handling.* Currently there's not great exception handling in the script. This needs to change, but hasn't caused problems for me yet.
125 *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. If there is interest, I'd be willing to try making other text translatable.
127 -Move all configuration to YAML file. Currently some configuration is made in the main script and some in the YAML file.- v. 0.0.2
129 Create full *rdoc documentation*. 
131 *Subfield Editing* -Allow subfield editing to take place in vim buffer?- As of 0.0.3 subfield editing is available though not well tested. Readline allows for nice editing. Still to do: Change the timestamp automatically and allow for adding subfields like 040d upon modification.
133 h2. Suggestions
135 Perl and MARC::Lint To have error checking of records turned on you must also have Perl and MARC::Lint installed.
137 h2. Using Koha with zcc
139 There is no integration yet between Koha and zcc, but I use both so am working towards that end. For now you can find some help on this page: "using Koha with zcc":http://zcc.rubyforge.org/koha.html
141 h2. Help/paches
143 email: "Jason Ronallo":mailto:jronallo+zcc@gmail.com
145 h2. License
147 Copyright (C) 2007 Jason Ronallo
149 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
151 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
153 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
155 h2. Contact
157 Comments are welcome. Send an email to "Jason Ronallo":mailto:jronallo+zcc@gmail.com.