Description¶
Lists files from a private Box folder using JWT authentication and outputs results to a text file. Useful for creating inventories of restricted data stored in Box without downloading the files.
Usage¶
python tools/list_box_files.py SUBFOLDER [options]Arguments¶
SUBFOLDER (required) - Subfolder identifier, numeric part only (e.g., 1234 for aearep-1234)
--box-folder-id- Box folder ID (default: fromBOX_FOLDER_PRIVATEenv var)--box-key-id- Box private key ID (default: fromBOX_PRIVATE_KEY_IDenv var)--box-enterprise-id- Box enterprise ID (default: fromBOX_ENTERPRISE_IDenv var)--output-file- Output file path (default:generated/manifest.restricted.txt)-v, --verbose- Enable verbose output
Example¶
python tools/list_box_files.py 1234 --output-file generated/box-files.txtRequirements¶
Python >= 3.9
boxsdk: Box Python SDK with JWT supportValid Box JWT application credentials
Environment Variables¶
BOX_FOLDER_PRIVATE- Box folder ID to list files fromBOX_PRIVATE_KEY_ID- Box JWT public key IDBOX_ENTERPRISE_ID- Box enterprise IDBOX_CLIENT_ID- Box client ID (optional if using config file)BOX_CLIENT_SECRET- Box client secret (optional if using config file)BOX_CONFIG_PATH- Directory containing the Box config fileBOX_PRIVATE_JSON- Base64 encoded content of the Box config JSON file
Output¶
Creates a text file listing all files in the specified Box folder, typically used for manifest generation.
See Also¶
download_box_private.py - Download files from private Box folders