/
Appending .OPEX metadata for Ingest into Preservica

Appending .OPEX metadata for Ingest into Preservica

Preservica Python Ingest Directions (PC)

Python is required to run the script provided. First go to Download Python and download the latest version (big yellow button “Download Python 3.12.4” as of writing but may be newer as you download). Run the installer and select “Add python to Path”. If you do not, python will not work and you will have to reinstall. Once it is completed you will have to install a couple extra libraries. In “terminal/command prompt” type

  1. python pip install pandas

  2. python pip install openpyxl

  3. Create a Preservica_Ingest folder in the lowest part of C: Drive

    1. C:\Preservica_Ingest

  4. Download the Preservica Python Ingest files here (update link) and save to the Downloads Folder.

  5. Right click the downloaded .zip folder and select “Extract All…”, then select Extract in the pop-up window.

  6. You should now have 3 files in the extracted folder

  7. Copy and past all 3 files into your Preservica ingest folder and create a Folder named “Source” (S must be uppercase)

  8. Place the Source files that need to be used into the Source folder and include the excel file “USmetadataTemplate.xlsx” that references your source files

  9. Right click in the file explorer window and select “Open in Terminal”, this will open the command line in the location of the files

  10. In the command line, now type, or copy and paste

    1. python .\utah_package_data.py

 

Preservica Python Ingest Directions (MAC)

To run the provided Python script, you'll need to install Python and some libraries. Follow the steps below: 

  1. Install Python 

    1. Go to the Python downloads page and download the latest version (as of writing, it’s "Download Python 3.12.4", but it might be a newer version when you check). 

    2. Follow the official instructions for installing Python on macOS. Agree to the terms and conditions and remove the installer when prompted. 

    3. Once installed, open Terminal by pressing Command + Space, typing "terminal", and pressing Enter

  2. Install Pip (if needed) 

    1. In Terminal, check if Pip is already installed by running:  python3 -m pip --version

    2. If Pip is not found, install it by running:  python3 -m ensurepip --upgrade 

      1. Or, you can update Pip to the latest version with:  python3 -m pip install --upgrade pip 

  3. Install Required Libraries 

    1. You'll need to install the following Python libraries by running these commands one at a time: 

      1. Pandas: pip3 install pandas 

      2. Openpyxl: pip3 install openpyxl 

      3. Lxml: pip3 install lxml 

    2. If you’re prompted to upgrade Pip during this process, follow the instructions provided in the terminal or ask for assistance if needed. 

  4. Prepare Your Workspace 

  5. Navigate to your Desktop:

    1. In the Terminal, type: cd Desktop 

    2. You can confirm you're in the right directory by checking the prompt. It should look like this: ethanrico@Ethans-MacBook-Pro-42 Desktop % 

  6. Create the Ingest Folder

    1. mkdir Preservica_Ingest 

  7. Download the Preservica Ingest Files: Download the .zip folder containing the script files from Box and save it to your Downloads folder. 

  8. Extract the Files

    1. Right-click the downloaded .zip file and select "Extract All...". Choose the default location for extraction. 

    2. After extraction, you should see three files in the folder. 

  9. Move the Files

    1. Copy and paste the three extracted files into the Preservica_Ingest folder you created on your Desktop. 

  10. Create the 'Source' Folder

    1. Inside the Preservica_Ingest folder, create a new folder named "Source" (make sure the "S" is uppercase). 

  11. Add Source Folder

    1. Place the source folder that you need to process into the "Source" folder. The name of the folder should match the corresponding entry in your Excel reference spreadsheet (Column A2, Folder Level Description), which should be in the Preservica_Ingest folder layer. 

Screenshot 2025-02-05 073912.jpg
Screenshot 2025-02-05 073926.jpg
  1. Edit the utah_package_data.ini file 

    1. In Finder, navigate to the Preservice_Ingest folder.  

    2. Right click on utah_package_data.ini and select open with TextEdit. 

    3. Edit each [DEFAULT] field so that the appropriate filepath is given, then ctrl (s)ave the file ex: 

 [DEFAULT] 

MasterDirectory = /Users/username/Desktop/Preservica_Ingest 

Source = /Users/username/Desktop/Preservica_Ingest/Source 

Metadata = /Users/username/Desktop/Preservica_Ingest/USmetadatTemplate.xlsx 

Step-by-step guide to finding the file path for a file on a Mac: 

  1. Open Finder: 

    1. Click the Finder icon (the blue face) in your dock to open a Finder window. 

  2. Navigate to the File: 

    1. Go to the location where your file is stored, whether that’s in your Documents, Downloads, Desktop, or a custom folder. 

  3. Right-click the File:  

    1. Once you find the file, right-click on it. If you don't have a right-click setup, you can also Control-click on the file. 

  4. Hold the Option Key: 

    1. While right-clicking, hold down the Option key on your keyboard. This will change the "Copy" option in the context menu to "Copy [file name] as Pathname." 

  5. Copy the File Path: 

    1. Select Copy [file name] as Pathname from the right-click menu. This will copy the full file path to your clipboard. 

  6. Paste the File Path: 

    1. You can now paste (Cmd + V) the full file path wherever you need it, like in a text editor, terminal, or another document. 

  7. Run the Script 

    1. In Finder, navigate to the Preservica_Ingest folder. 

    2. Right-click in the folder and select "Open in Terminal". This will open the terminal directly in the folder. 

    3. In the Terminal, run the script with:  python3 ./utah_package_data.py