Skip to content
Snippets Groups Projects

pyIRICdata - A python API for interacting with IRIC-data

Install

Load your iric-data py3 virtual environment

module load python/3.6.7
# create your virtual environment if not already installed
python3 -m venv ~/.virtualenvs/iric-data
source ~/.virtualenvs/iric-data/bin/activate

Install

pip install --upgrade pip setuptools wheel
pip install -e .

Examples

from pyiricdata.Client import Client

username = 'test'
password = 'test1234'
url = 'http://127.0.0.1:8000/'

# setup client
client = Client(username, password, url)

# view datasets
client.datasets

# view dataset files
client.get_dataset_filelist('DS12345678')

# download complete dataset
client.dwnl_dataset('DS12345678')

# or just download a single file
client.dwnl_file_content('DF12345678')
client.dwnl_file_annotation('DF12345678')

# upload file (file_path, file_name, lab, dataset, annotations)
client.file_upload('/home/user/file.txt', 'file1', 'Bioinformatique', 'DF12345678', {"file_has": "cool_annotation"})

# update file (file_id, file_name, annotations, lab)
client.file_update('DF12345680', 'file1', {"file_has": "very_cool_annotation"}, 'Bioinformatique')