Skip to content

Commit

Permalink
Merge pull request #14 from Australian-Imaging-Service/per-file-downl…
Browse files Browse the repository at this point in the history
…oad-env-var-creds

Per file download env var creds
  • Loading branch information
tclose authored Sep 6, 2024
2 parents ed47996 + 1e8f189 commit 9e81f5b
Show file tree
Hide file tree
Showing 6 changed files with 800 additions and 434 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
/.history
test/*.xml
.vscode
.venv
*.venv
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'A collection of scripts for downloading/uploading and listing '
'data from XNAT repositories.'),
long_description=open('README.rst').read(),
install_requires=['xnat==0.4.3',
install_requires=['xnat>=0.6',
'progressbar2>=3.16.0',
'future>=0.16'],
python_requires='>=3.4',
Expand Down
39 changes: 28 additions & 11 deletions test/misc.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
from xnatutils import put, get

put('timepoint0group0member0',
'dicom_scan',
'/Users/tclose/git/workflows/arcana2/arcana2/data/repositories/xnat/tests/dicom-dataset/sub1/sample-dicom',
# server='http://dev.xnat.sydney.edu.au',
server='http://localhost:8080',
user='admin', password='admin',
project_id='test',
resource_name='DICOM',
create_session=True)
import os
from xnatutils import get, put

os.environ["XNAT_USER"] = "admin"
os.environ["XNAT_PASS"] = "admin"
os.environ["XNAT_HOST"] = "http://localhost:8080"

get(
"subject02_MR01",
download_dir="/Users/tclose/Downloads/xnat-get-test2",
# server="http://localhost:8080",
scans=["t1w"],
# user="admin",
# password="admin",
project_id="OPENNEURO_T1W",
method="per_file",
)


put(
"subject02_MR01",
"t3w",
"/Users/tclose/Downloads/xnat-get-test2/subject02_MR01/1-t1w",
project_id="OPENNEURO_T1W",
method="per_file",
overwrite=True,
resource_name="NIFTI_GZ_X",
)


# get(server='http://localhost:8989',
Expand Down
Loading

0 comments on commit 9e81f5b

Please sign in to comment.