2.1 KiB
2.1 KiB
mdrs-client-python
The mdrs-client-python is python library and a command-line client for up- and downloading files to and from MDRS based repository.
Installing
pip install -e .
Example Usage
config create
Create remote host configuration
$ mdrs config create neurodata https://neurodata.riken.jp/api
login
Login to remote host
$ mdrs login neurodata:
Username: (enter your login name)
Password: (enter your password)
logout
Logout from remote host
$ mdrs logout neurodata:
whoami
Print current user name
$ mdrs whoami neurodata:
labs
List all laboratories
$ mdrs labs neurodata:
ls
List the folder contents
$ mdrs ls neurodata:/NIU/Repository/
$ mdrs ls -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/
mkdir
Create a new folder
$ mdrs mkdir neurodata:/NIU/Repository/TEST
upload
Upload the file or directory
$ mdrs upload ./sample.dat neurodata:/NIU/Repository/TEST/
$ mdrs upload -r ./dataset neurodata:/NIU/Repository/TEST/
download
Download the file or folder
$ mdrs download neurodata:/NIU/Repository/TEST/sample.dat ./
$ mdrs download -r neurodata:/NIU/Repository/TEST/dataset/ ./
$ mdrs download -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/Readme.dat ./
mv
Move or rename the file or folder
$ mdrs move neurodata:/NIU/Repository/TEST/sample.dat neurodata:/NIU/Repository/TEST2/sample2.dat
$ mdrs move neurodata:/NIU/Repository/TEST/dataset neurodata:/NIU/Repository/TEST2/
rm
Remove the file or folder
$ mdrs rm neurodata:/NIU/Repository/TEST2/sample2.dat
$ mdrs rm -r neurodata:/NIU/Repository/TEST2/dataset
metadata
Get a folder metadata
$ mdrs metadata neurodata:/NIU/Repository/TEST/
$ mdrs metadata -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/
file-metadata
Get the file metadata
$ mdrs file-metadata neurodata:/NIU/Repository/TEST/dataset/sample.dat
$ mdrs file-metadata -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/Readme.txt
help
Show the help message and exit
$ mdrs -h