User Tools

Site Tools


installing_and_using_scripts

Overview

All the scripts used in the Du Bois digitization project are available in:

r:/credo/utilities

All the scripts are in Python and available as standalone Windows executables that can run on any Windows system with minimal steps to install or as source python files, which require the Python interpreter and several libraries. r:/credo/utilities contains a folder for each script. In that folder is a README.txt that describes the usage of the script, though each script is also described on the Wiki. There is also a scriptname.exe file that is the standalone executable of the script and a src folder for all the original Python source.

Currently, there are seven utilities available:

  • mods (checking and manipulating MODS records)
  • checkimages (checking scanned images)
  • image_view (spot-checking MODS and scans in a Web interface)
  • countfiles (counting files for benchmarking)
  • stripids (creating a list of IDs from search results)
  • extract (extracting an converting images and MODS records)
  • ingest (adding and updating MODS records in the mods-search database)

Information about installing and running both the executables and the source is below…

Installation & Use

Install Script Executables

All the executables live in r:/credo/metadata/utilities/scriptname. To install…

  • Copy the scriptname.exe file to your c:\Temp directory. Make sure you copy only and keep the original version in the r:/credo/metadata/utilities directory.
  • Put in a ticket with the Systems department to move the .exe file to the c:\Windows folder.

Use Script Executables

To use the scripts do the following…

  • Open the command prompt. You can use the standard Windows one, or a nice alternative is Console2
  • Once in the command prompt navigate to the drive where the files you want to manipulate live (e.g. y: cd \scans\dubois_scanning\staging\box112)
  • Use the script by typing the name of the script at the command prompt followed by the appropriate options and/or arguments:

e.g.

Y:\scans\dubois_scanning\staging\box112> mods -h .

note: The period at the end is the argument that tells it to apply the script to that directory.

Source

To run the source python files, it's necessary to install the Python interpreter. I prefer Active Python for Windows.

The following libraries will also need to be installed:

  • LXML (XML library for Python) Installation could be as simple as typing >pypm install lxml assuming you have Active Python installed.
  • Python Imaging Library (PIL) (Manipulating images and converting formats)
  • ASPW (Library for interacting with SQLite databases). This is necessary to run the mods-search and image_view scripts from source.

Other smaller libraries are included with the source files of the scripts that depend on them.

To run python scripts, first enter the command line and navigate into the source directory, type python and the script name:

>python /path/to/mods.py -h

If you've made changes to the original source and feel compelled to compile new executables, I use the py2exe library. The setup.py files used to create the executables are in the src folder for each script. Install py2exe and run python setup.py py2exe and away you go.

installing_and_using_scripts.txt · Last modified: 2019/11/19 18:50 (external edit)