2023-07-31 18:10:10 -07:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-09-11 11:40:56 -04:00
|
|
|
# Processes several files in a nested folder structure from box://utic-test-ingest-fixtures/
|
2023-07-31 18:10:10 -07:00
|
|
|
# through Unstructured's library in 2 processes.
|
|
|
|
|
|
|
|
# Structured outputs are stored in box-output/
|
|
|
|
|
|
|
|
# Setting up your App/Credential to access Box folders/files:
|
|
|
|
# First of all, this does not work with a free Box account.
|
|
|
|
# Make sure the App service email is a collaborator for your folder (co-owner or editor)
|
|
|
|
# Make sure you have the 'write all files' application scope
|
|
|
|
# Maybe check 'Make api calls as the as-user header'
|
|
|
|
# REAUTHORIZE app after making any of the above changes
|
|
|
|
|
2023-09-02 08:50:31 -07:00
|
|
|
# box-app-config is the path to a json file, available in the App Settings section of your Box App
|
2023-07-31 18:10:10 -07:00
|
|
|
# More info to set up the app:
|
|
|
|
# https://developer.box.com/guides/authentication/jwt/jwt-setup/
|
|
|
|
# and set up the app config.json file here:
|
|
|
|
# https://developer.box.com/guides/authentication/jwt/with-sdk/
|
|
|
|
|
2023-12-11 20:04:15 -05:00
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
2023-07-31 18:10:10 -07:00
|
|
|
cd "$SCRIPT_DIR"/../../.. || exit 1
|
|
|
|
|
|
|
|
PYTHONPATH=. ./unstructured/ingest/main.py \
|
2023-12-18 23:48:21 -08:00
|
|
|
box \
|
|
|
|
--box-app-config "$BOX_APP_CONFIG_PATH" \
|
|
|
|
--remote-url box://utic-test-ingest-fixtures \
|
|
|
|
--output-dir box-output \
|
|
|
|
--num-processes 2 \
|
|
|
|
--recursive \
|
|
|
|
--verbose
|