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.
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
- Download the repository via cloning to your local IDE or using GitHub's Code button and Download as ZIP
- Run
pip install requirements.txt
or check the import statements for the script you want to run and install those packages - Create dotenv files (dev, test, and prod) by following the Environments Wiki page
- 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.
- Run the script as
python3 <name_of_script.py>
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.
- Select which script you would like to run
- Run the script with the following command for python scripts:
python3 <name_of_script.py>
- 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.
- 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.
- 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
- ArchivesSpace community