asInventory
Manage file-level ArchivesSpace inventories with spreadsheets.
Basic Use
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.cfg
with your ArchivesSpace credentials and rename tolocal_settings.cfg
(
[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 uses 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
For Resource, use id_0
For other components use Ref ID
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
output
directory. 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
dao
directory. If dao paths are set up correctly inlocal_settings.cfg
asInventory will also rename files to their newly created ASpace IDs and move them to a webserver.
Save the spreadsheet to the
input
directoryrun asUpload.exe (may take a minute to open the first time)
The spreadsheet file will be moved into the
complete
directory after the upload is completed. WARNING: files with the same name in this directory will be overwritten.
Prerequisites
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 wxPython:
For Windows use the installer, make sure to select the version compatible with your Python
For Macs
brew install wxpython
should work, but is untestedFor 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
Additional features
Validation
validate.exe
(and 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 dao
directory.
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
dao
directoryRun
daoList.exe
to get a text listing of the filesPaste 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
local_settings.cfg