2023-05-01 20:00:32 +09:00
|
|
|
# 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
|
2023-05-09 19:45:03 +09:00
|
|
|
Login to remote host
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
$ mdrs login neurodata:
|
|
|
|
Username: (enter your login name)
|
|
|
|
Password: (enter your password)
|
|
|
|
```
|
|
|
|
|
|
|
|
### logout
|
|
|
|
Logout from remote host
|
|
|
|
```
|
|
|
|
$ mdrs logout neurodata:
|
|
|
|
```
|
|
|
|
|
|
|
|
### whoami
|
2023-05-10 18:17:35 +09:00
|
|
|
Print current user name
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
$ mdrs whoami neurodata:
|
|
|
|
```
|
|
|
|
|
|
|
|
### labs
|
|
|
|
List all laboratories
|
|
|
|
```
|
|
|
|
$ mdrs labs neurodata:
|
|
|
|
```
|
|
|
|
|
|
|
|
### ls
|
|
|
|
List the folder contents
|
|
|
|
```
|
|
|
|
$ mdrs ls neurodata:/NIU/Repository/
|
2023-05-10 20:10:43 +09:00
|
|
|
$ mdrs ls -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
### mkdir
|
|
|
|
Create a new folder
|
|
|
|
```
|
|
|
|
$ mdrs mkdir neurodata:/NIU/Repository/TEST
|
|
|
|
```
|
|
|
|
|
|
|
|
### upload
|
2023-05-09 19:45:03 +09:00
|
|
|
Upload the file or directory
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
$ mdrs upload ./sample.dat neurodata:/NIU/Repository/TEST/
|
|
|
|
$ mdrs upload -r ./dataset neurodata:/NIU/Repository/TEST/
|
|
|
|
```
|
|
|
|
|
|
|
|
### download
|
2023-05-09 19:45:03 +09:00
|
|
|
Download the file or folder
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
$ mdrs download neurodata:/NIU/Repository/TEST/sample.dat ./
|
2023-05-10 20:10:43 +09:00
|
|
|
$ mdrs download -r neurodata:/NIU/Repository/TEST/dataset/ ./
|
|
|
|
$ mdrs download -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/Readme.dat ./
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
|
2023-05-09 19:45:03 +09:00
|
|
|
### mv
|
|
|
|
Move or rename the file or folder
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
$ mdrs move neurodata:/NIU/Repository/TEST/sample.dat neurodata:/NIU/Repository/TEST2/sample2.dat
|
2023-05-09 19:45:03 +09:00
|
|
|
$ mdrs move neurodata:/NIU/Repository/TEST/dataset neurodata:/NIU/Repository/TEST2/
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
|
2023-05-09 19:45:03 +09:00
|
|
|
### rm
|
|
|
|
Remove the file or folder
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
2023-05-09 19:45:03 +09:00
|
|
|
$ mdrs rm neurodata:/NIU/Repository/TEST2/sample2.dat
|
|
|
|
$ mdrs rm -r neurodata:/NIU/Repository/TEST2/dataset
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
|
2023-05-10 18:17:35 +09:00
|
|
|
### metadata
|
|
|
|
Get a folder metadata
|
|
|
|
```
|
2023-05-10 20:10:43 +09:00
|
|
|
$ mdrs metadata neurodata:/NIU/Repository/TEST/
|
|
|
|
$ mdrs metadata -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/
|
2023-05-10 18:17:35 +09:00
|
|
|
```
|
|
|
|
|
2023-05-01 20:00:32 +09:00
|
|
|
### file-metadata
|
|
|
|
Get the file metadata
|
|
|
|
```
|
|
|
|
$ mdrs file-metadata neurodata:/NIU/Repository/TEST/dataset/sample.dat
|
2023-05-10 20:10:43 +09:00
|
|
|
$ mdrs file-metadata -p PW_OPEN_PASSWORD neurodata:/NIU/Repository/PW_Open/Readme.txt
|
2023-05-01 20:00:32 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
### help
|
|
|
|
Show the help message and exit
|
|
|
|
```
|
|
|
|
$ mdrs -h
|
|
|
|
```
|