Skip to content

An assortment of scripts for managing and editing metadata for ArchivesSpace

Notifications You must be signed in to change notification settings

Smithsonian/caas-aspace-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smithsonian ArchivesSpace Scripts

Overview

A collection of Python/SQL scripts for data cleanup, management, and others related to the Smithsonian's ArchivesSpace implementation. Detailed descriptions of the various scripts can be found in the Wiki Script Descriptions page. Also in the Wiki, you can find best practices for logging, testing, and environment management.

Getting Started

Dependencies

Not every script requires every package as listed in the requirements.txt file. If you need to use a script, check the import statements at the top to see which specific packages are needed.

  • ArchivesSnake - Library used for interacting with the ArchivesSpace API
  • loguru - Library used for generating log files
  • jsonlines - Library used for creating and appending to jsonl files for storage of JSON data
  • python-dotenv - Library used for writing environment variables for script info like credentials

Installation

  1. Download the repository via cloning to your local IDE or using GitHub's Code button and Download as ZIP
  2. Run pip install requirements.txt or check the import statements for the script you want to run and install those packages
  3. Create dotenv files (dev, test, and prod) by following the Environments Wiki page
  4. Create a logs folder in your project's local directory for storing log files. More information about logging can be found in the logging Wiki page.
  5. Run the script as python3 <name_of_script.py>

Script Arguments

Each script has its own parameters, most not requiring any arguments to run. However, you will want to take time to adjust the script to meet your own needs. For instance, you may want to set up a 'data' and/or 'reports' folder in your code's test_data directory to store exported CSV's, Excel spreadsheets, or any other outputs that are generated from the script. See the Script Descriptions Wiki page for more info on what each script does.

Workflow

  1. Select which script you would like to run
  2. Run the script with the following command for python scripts: python3 <name_of_script.py>
    1. If there are arguments, make sure to fill out those arguments after the python script name. Most scripts just need the information listed in dotenv file created in the installation step above.
    2. If the script is not a python script, but an SQL statement, you can either download the SQL file or copy the code to your local SQL developer environment and run it there.

Authors

  • Mark Custer - Manager of the Community Applications and Archival Support Team at the Smithsonian Institution
  • Corey Schmidt - IT Specialist at the Smithsonian Institution
  • Lora Woodford - IT Specialist at the Smithsonian Institution

Acknowledgements

  • ArchivesSpace community

About

An assortment of scripts for managing and editing metadata for ArchivesSpace

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages