Configuring Environmental Variables for Scripts

Certain scripts utilized in our workflows, such as clean_spec_csv_to_excel.py and fmrest_barcode, require specific environmental variables to be set in your .zshrc file to function correctly. These variables typically include API keys, tokens, and configuration settings necessary for the scripts to interact with external services like Trello and FileMaker.

Setting up Environmental Variables:

  1. Open your Terminal application.
  2. Access your .zshrc file by typing:
    open -e ~/.zshrc
    

    This command will open your .zshrc file in TextEdit. If the file does not exist, it will be created.

  3. Add the required environmental variables. Below are examples of how you might configure your .zshrc for our specific scripts:

    • For clean_spec_csv_to_excel.py, which interfaces with Trello:
      export TRELLO_API_KEY='your_trello_api_key'
      export TRELLO_TOKEN='your_trello_token'
      export TRELLO_LIST_ID='your_trello_list_id'
      
    • For fmrest_barcode, which requires FileMaker server details:
      export FILEMAKER_SERVER='your_filemaker_server'
      export FILEMAKER_DATABASE='your_filemaker_database'
      export FILEMAKER_LAYOUT='your_filemaker_layout'
      
  4. Save and close TextEdit. After adding your variables, save the changes and close the editor.

  5. Apply the changes by typing the following in Terminal:
    source ~/.zshrc
    

    This command reloads your .zshrc, applying the new environmental settings.

Verification:

  • To verify that the environmental variables are set correctly, you can echo them in the Terminal. For example:
    echo $TRELLO_API_KEY
    

    This should display the value you set for the TRELLO_API_KEY variable.

Troubleshooting:

  • If changes to .zshrc do not seem to apply, make sure you have saved the file after editing and run source ~/.zshrc again.
  • If a script fails to recognize the variables, ensure that there are no typos in your .zshrc file and that all variable names are correct.

By setting up these variables as instructed, users will ensure smooth operation of scripts requiring specific configurations, supporting effective digitization and preservation workflows.