Skip to content

cul/cul-as-scripts

Repository files navigation

CUL ArchivesSpace Scripts

Scripts for interacting with the Columbia University Libraries ArchivesSpace instance on an ad-hoc basis. Includes tools for managing access restrictions, container data, digital objects, locations, and metadata exports.

Requirements

  • Python 3.10+
  • See requirements.txt for dependencies

Setup

  1. Install dependencies: pip install -r requirements.txt
  2. Create a credentials file by renaming local_settings.cfg.example to local_settings.cfg and updating it with your ArchivesSpace credentials and base URL.

Scripts

Script Description
add_containers.py Propagates container instance data to archival objects missing it
add_dlc_dos.py Creates and attaches IIIF digital objects to archival objects
add_locations.py Adds location data to top containers
add_metadata_rights.py Adds metadata rights declarations to published resources
aspace_barcodes.py Fetches top container barcodes using FOLIO HRIDs; adds barcodes to top containers from a spreadsheet
reorder_one_series.py Identifies and removes redundant single-series structure
restriction_lifter.py Exports and removes expired access restriction notes
update_access_notes.py Updates access restriction note text across a series or repository
update_hyacinth_metadata.py Exports archival object metadata for Hyacinth import
update_instances.py Disambiguates box numbers by adding prefixes to container indicators

Contribution standards

Style

This project follows PEP 8 style guidelines, enforced in VS Code via the following extensions:

  • black — formats code automatically on save
  • isort — sorts imports alphabetically and by type on save, using the black profile for compatibility
  • flake8 — checks for style issues, errors, and complexity; configured via .flake8

To replicate this setup, install the Black Formatter, isort, and Flake8 VS Code extensions. Project settings are in .vscode/settings.json.

Documentation

Docstrings follow Google's docstring style guide. Use one-line docstrings for immediately self-explanatory cases; use multi-line docstrings for everything else.

Tests

New code should have unit tests. Tests are written using pytest and pytest-mock, and run via tox. To run the tests and coverage report:

tox -e py311

About

CUL scripts for ArchivesSpace API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages