Manage file-level ArchivesSpace inventories with spreadsheets
Version 2.0 now uses archivessnake
This tool has been tested with ArchivesSpace 2.x and 3.x. It makes iterative changes through the API. You should always do significant testing on a development instance of ASpace before using it on production data to make sure it acts as you expect.
pip install git+https://github.com/UAlbanyArchives/asInventory.gitgit clone https://github.com/UAlbanyArchives/asInventory
cd asInventory
pip install .pip install -e .If you don't already have ArchivesSnake configured, create a ~/.archivessnake.yml with your ArchivesSpace credentials:
baseurl: https://your-aspace-instance.edu/api
username: your_username
password: your_passwordCreate ~/asinventory.yml to specify your repository ID:
repository: 2If this file doesn't exist, the default repository ID of "2" will be used.
asInventory requires these directories (will be created automatically when scripts run):
input
output
complete
dao
After installation, run scripts as console commands or directly with Python:
# As console commands (if Python Scripts directory is in PATH)
asdownload
asupload
asvalidate
# Or run directly with Python
python asDownload.py
python asUpload.py
python validate.py- Run
asdownload(orpython asDownload.py) - Select the level to export:
- Select "Resource" (r) to export a folder list from a collection that has no series
- Select "Archival Object" (ao) to export a folder list from a series, subseries, or other component
- Enter the ID for the parent of the folder list you want to export:
- Click "OK" and a list of files exported will print to the console. This may take some time for large file listings.
- If the export is successful, you will be given the option to open the output directory to view the exported file
- A new Spreadsheet file will be placed in the
outputdirectory. WARNING: files with the same name in this directory will be overwritten.
- Make a copy of asInventory.xlsx, you can name it anything you'd like.
- Open the spreadsheet and add a folder listing:
- Mandatory fields:
- Level (I2) must be "resource" for collection level with no series, or "archival object"
- RefID (I3) must be id_0 for resource parent or ref_id for archival object parent
- Title (I1) is not mandatory and can be anything, sheet name can also be anything
- Many columns can be left blank
- If an ID (column A) is entered, asInventory will find and update an existing record
- If no ID is entered, asInventory will create a new archival object child
- If URIs for locations or containers are entered, asInventory will link these records; otherwise, new containers and locations will be created if a label and indicator are listed
- Accepts up to 5 dates using ISO format (e.g., "1977/1988" or "1903-03-17/1917-01-15")
- Display dates are optional and are entered in the ASpace Expression field
- Can make Access Restriction (column T), General Note (column U), and Scope (column V) notes.
- Can create and link digital objects. This can be a link entered in column W, or the filename of a file placed in the
daodirectory. If dao paths are set up correctly inlocal_settings.cfgasInventory will also rename files to their newly created ASpace IDs and move them to a webserver. 
- Mandatory fields:
- Save the spreadsheet to the
inputdirectory - Run
asupload(orpython asUpload.py) - The spreadsheet file will be moved into the
completedirectory after the upload is completed. WARNING: files with the same name in this directory will be overwritten.
Requires Python 3.7+
Dependencies are automatically installed with pip:
- openpyxl (2.6.4)
- archivessnake
- pyyaml
asvalidate (or python validate.py) will validate all dates entered in all spreadsheets in the input folder. This helps ensure they're compatible with ArchivesSpace to reduce errors during upload.
Digital objects can be created by entering URLs in column W of the upload spreadsheet. The tool will create ArchivesSpace digital object records and link them to the appropriate archival objects.
Executables can be built with PyInstaller:
pyinstaller --onefile asUpload.py
pyinstaller --onefile asDownload.py
pyinstaller --onefile validate.pyComments and pull requests welcome.
Greg Wiedeman
This project is in the public domain

