Manage file-level ArchivesSpace inventories with spreadsheets
This tool has been tested with ArchivesSpace 1.5.x on Windows at UAlbany. The Python source should also run on Mac and Linux with dependencies, but is only minimally tested on Ubuntu 14.04.
This tool 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.
First download and extract the zip file or clone the repo with git:
git clone https://github.com/UAlbanyArchives/asInventory
Edit the sample config file
local_settings_sample.cfgwith your ArchivesSpace credentials and rename to
[asInventory]section is only required for the optional dao upload workflow, you can add digital objects without editing these if you just enter URLs.)
asInventory requires three directories that will be created when you first run it:
input output complete dao
To export an inventory
- run asDownload.exe (may take a minute to open the first time)
- Select the level to export
- Select "Resource" to export a folder list from a collection that has no series
- Select "Archival Object" to export a folder list from a series, sub series, or other component
- Paste in 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.
To import an inventory
- 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 (I4) 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 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 to the new archival object record, if they are left place, new containers and locations will be created if a label and indicator are listed
- Accepts up to 5 Dates and uses Normal dates (i.e. "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 in
local_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
- run asUpload.exe (may take a minute to open the first time)
- 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.
The executable files should have no dependencies on Windows other than ArchivesSpace. asInventory has been tested on 1.5.x
Running the Python source requires Python some non-standard libraries, and the custom archives_tools library:
Installing dependencies to run from Python source
These commands will install the necessary dependencies if you want to run the raw Python instead of the executable files. Python is of course required, and although all the code should be compatible with both Python 2.7 and Python 3, Python 2.7 is probably safer for wxPython.
pip install configparser pip install openpyxl git clone https://github.com/UAlbanyArchives/archives_tools cd archives_tools python setup.py install
- For Windows use the installer, make sure to select the version compatible with your Python
- For Macs
brew install wxpythonshould work, but is untested
- For Ubuntu, this should work:
sudo apt-get install python-wxgtk2.8 python-wxtools wx2.8-doc wx2.8-examples wx2.8-headers wx2.8-i18n
validate.py) will validate all dates entered in all spreadsheets in the
input folder. This should make them compatible with ASpace to reduce errors during uploading. Hopeful more detailed validation to come.
Creating digital objects
daoList.exe will create
daoList.txt which will list all files placed in the
The envisioned use case for this is:
- You have a lot of PDFs (or anything else really) of the folders in the file listing you want to upload.
- You place these PDFs in the
daoList.exeto get a text listing of the files
- Paste that listing into the upload spreadsheet in the DAO Filename column (W).
- During upload, asInventory will create ASpace digital objects, rename these files to their ASpace UUIDs, and move them to a webserver path listed in
General note on sustainability
This tool is in active use at UAlbany, and thus I'm committed to maintaining this project for at least the near future. It does rely on the custom archives_tools library with makes it relatively small and simple. (asDownload.py is under 400 lines of code, GUI and all). If a community-led ArchivesSpace library for Python is developed, I'll make a strong effort to move asInventory to that library.
Comments and pull requests welcome.
This project is in the public domain