Skip to content

Go-Aspace utility for bulk finding aid export, validation and reformatting.

License

Notifications You must be signed in to change notification settings

nyudlts/aspace-export

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aspace-export, v1.0.0b

Command-line utility for bulk export, validation and reformatting of EAD finding aids and MARC records from Archivespace.

Install From Binary

  1. Download the latest binary for Mac or linux https://github.com/nyudlts/aspace-export/releases/tag/v1.0.1b
  2. Enter your ArchivesSpace credentials into the go-aspace.yml file included in the zip.

Install With Go

$ go install github.com/nyudlts/aspace-export

Build From Source

Pre-requisite: libxml2 and libxml2 development headers
$ make build
$ sudo make install //installs aspace-export to /usr/local/bin

Package Distribution

$ make package VERSION="release version" OS="osx,linux", this will build the app, zip the app, the sample go-aspace.yml file and the readme into a zip located in the /bin directory
example: $ make package VERSION="v1.0.0b" OS="linux", this will create /bin/linux/aspace-export-linux-v1.0.0b.zip

Run

$ aspace-export --config /path/to/go-aspace.yml --environment your-environment-key --format ead-or-marc [options]

notes:

  • The underlying C xml lib, libxml2, will output voluminous, and not always helpful, info about xml errors to stderr, 2> /dev/null ignores the output, you can redirect to a file by replacing /dev/null if you want to analyze the libxml2 output
  • The program will create a directory hierarchy at the location set in the --export-location option named `aspace-export-[timestamp]. A subdirectory will be created for each repository that was exported, with the name of the repository's slug.
  • Within each repository directory there will be an exports directory containing all exported finding aids and a failures directory for any file that fails to export from ArchivesSpace
  • If the validate option is set when the running the application any finding aids that fail validation will be written to a subdirectory named invalid.
  • A log file will be created named aspace-export.log which will be created in the root of output directory as defined in the --export-location option.
  • A Report with statistics will be created named aspace-export-report.txt will be created in the root of output directory as defined in the --export-location option.

example output structure
/path/top/eexport-location/aspace-exports-[timestamp]
        aspace-exports.log
        aspace-exports-report.txt
        /tamwag
                /exports
                        tam_001.xml
                        tam_002.xml
                /invalid
                        tam_003.xml
                /failures
                        tam_004.xml

Command-Line Arguments

--config, path/to/go-aspace.yml configuration file, required
--environment, environment key in config file of the instance to export from, required
--export-location, path/to/the location to export resources, default: .
--format, format of export: ead or marc, default: ead
--include-unpublished-resources, include unpublished resources in exports, default: false
--include-unpublished-notes, include unpublished notes in exports, default: false
--reformat, tab-reformat ead files (marcxml are tab-formatted by ArchivesSpace), default: false
--repository, ID of the repository to be exported, 0 will export all repositories, default: 0
--resource, ID of the resource to be exported, 0 will export all resources, default: 0
--timeout, client timeout in seconds to, default: 20
--version, print the application and go-aspace client version
--workers, number of concurrent export workers to create, default: 8
--help, print this help screen

Exit Error Codes

  1. no errors
  2. could not create a log file to write to
  3. mandatory options not set
  4. the location set at export-location set does not exist or is not a directory
  5. go-aspace library could not create an aspace-client
  6. could not get a list of repositories from ArchivesSpace
  7. could not get a list of resources from ArchivesSpace
  8. could not create a aspace-export directory at the location set at --export-location
  9. could not create subdirectories in the aspace-export