This repository contains a Python script to upload files to OMIX3 storage and update Indexd records using the Gen3 SDK.
- Gen3 Credentials: You must have a cred.json file containing your Gen3 API token with appropriate write permissions to the target project.
- Access to S3 Bucket: Ensure that your Gen3 project is configured with an S3 bucket where files can be uploaded.
- Python Environment: Python 3.10+ is recommended.
python3 -m venv ~/gen3_envsource ~/gen3_env/bin/activategen3_env\Scripts\activatepip install -r requirements.txt- gen3.auth and gen3.file (from gen3)
- requests (for HTTP uploads)
- PyJWT (for decoding token information)
- boto3, botocore, jmespath, s3transfer (if using S3 uploads)
In the script ( scripts/gen3sdk_upload_file.py ), there is a variable called CREDENTIALS that points to your Gen3 credentials file:
CREDENTIALS = "/path/to/the/cred.json"➡️ Update this path to point to your actual Gen3 credentials file before running the script.
python scripts/gen3sdk_upload_file.py <file_to_upload>python scripts/gen3sdk_upload_file.py ~/path/to/test_s3_in_01.txtUsage:
Single file: python gen3sdk_download_file.py <GUID> [output_dir]
Multiple files: python gen3sdk_download_file.py <GUID1> <GUID2> ... [output_dir] python gen3sdk_download_file.py 0479c9c6-89bc-4717-8952-763ccb555eba
python gen3sdk_download_file.py guid1 guid2 guid3 ./my_downloads/