Skip to main content

asInventory

Manage file-level ArchivesSpace inventories with spreadsheets

Version 2.0 now uses archivessnake

Warning note

This tool has been tested with ArchivesSpace 2.x-4.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.

Installation

Install from GitHub (Recommended)

pip install git+https://github.com/UAlbanyArchives/asInventory.git

Install from local directory

git clone https://github.com/UAlbanyArchives/asInventory
cd asInventory
pip install .

Development mode (for contributors)

pip install -e .

Configuration

ArchivesSnake Configuration

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_password

Repository selection is currently fixed to repository 2 by default.

Base Directory

By default, input, output, complete, dao, and error.log are located relative to the installed package directory (or the EXE location when frozen), which is often not where you want them when installed via pip.

Set the ASINVENTORY_BASE_DIR environment variable to override this default and point the tools at a working directory of your choice:

# Windows (PowerShell)
$env:ASINVENTORY_BASE_DIR = "C:\work\asinventory"

# macOS/Linux
export ASINVENTORY_BASE_DIR=/path/to/asinventory

The --base-dir CLI argument, when provided, takes precedence over ASINVENTORY_BASE_DIR.

Required Directories

asInventory requires these directories (will be created automatically when scripts run):

input
output
complete
dao

Running the Scripts

After installation, you can use either the new unified CLI or the existing script entry files.

CLI

asinventory upload
asinventory download
asinventory validate

Optional path overrides are available for folders that otherwise default relative to the script or EXE location:

asinventory upload --input C:\work\input --complete C:\work\complete --dao C:\work\dao
asinventory download --output C:\work\output
asinventory validate --input C:\work\input --dao C:\work\dao

If override arguments are omitted, the tools continue to use these default relative folders next to the script or built EXE:

input
output
complete
dao

Existing script and EXE workflow

The original entry files remain supported for direct execution, double-clicked EXEs, and manual PyInstaller builds.

Run scripts as console commands or directly with Python:

# Legacy console commands / optional aliases
asdownload
asupload
asvalidate

# Direct Python scripts
python asDownload.py
python asUpload.py
python asValidate.py

Exporting an inventory

  1. Run asinventory download, asdownload, or python asDownload.py
  2. 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
  3. Enter the ID for the parent of the folder list you want to export:
    • For Resource, use id_0
    • For other components use Ref ID
  4. Click "OK" and a list of files exported will print to the console. This may take some time for large file listings.
  5. If the export is successful, you will be given the option to open the output directory to view the exported file
  6. A new Spreadsheet file will be placed in the output directory. WARNING: files with the same name in this directory will be overwritten.

Example with an output override:

asinventory download --output C:\work\output

To import an inventory

  1. Make a copy of asInventory.xlsx, you can name it anything you'd like.
  2. 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 dao directory.
  3. Save the spreadsheet to the input directory
  4. Run asinventory upload, asupload, or python asUpload.py
  5. 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.

Example with folder overrides:

asinventory upload --input C:\work\input --complete C:\work\complete --dao C:\work\dao

Dependencies

Requires Python 3.7+

Dependencies are automatically installed with pip:

Additional Tools

Validation

asinventory validate, asvalidate, or python asValidate.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.

Example with an input override:

asinventory validate --input C:\work\input

Building Executables (Optional)

Executables can be built with PyInstaller:

pyinstaller --onefile asUpload.py
pyinstaller --onefile asDownload.py
pyinstaller --onefile asValidate.py

The existing .spec files can continue to be used as-is because the original entry scripts were preserved.

Contributing

Comments and pull requests welcome.

Authors

Greg Wiedeman

License

This project is in the public domain

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

asinventory-2.0.0.tar.gz (34.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asinventory-2.0.0-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file asinventory-2.0.0.tar.gz.

File metadata

  • Download URL: asinventory-2.0.0.tar.gz
  • Upload date:
  • Size: 34.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for asinventory-2.0.0.tar.gz
Algorithm Hash digest
SHA256 b149440b944c3907166d6351f7c66f6b12d5ae9c6bf00731c7a57af7dbd54238
MD5 0760595b5c67c9c253ee7add8c9efa50
BLAKE2b-256 38d20adfff46a20ca674723077e2c0bd4d89753df361a62f9a5aca55521a611f

See more details on using hashes here.

File details

Details for the file asinventory-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: asinventory-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for asinventory-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7b9e5ebeecab28e44f91cfa8d40467689d04a7f0c1bb497eba536bdfccdffe7
MD5 35893c86ad602169b700fe52f379d72d
BLAKE2b-256 70c1495a5c3d416fb54e6ac33c73a90012ad9b724a0a9c17d2b0fcc0f74977f8

See more details on using hashes here.

Release history Release notifications | RSS feed

2.1.1

2 files

2.1.0

2 files

This release

2.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page