SIMEXP / Repo2Data

Automatic data fetcher from the web
MIT License
7 stars 3 forks source link

Feature request: multiple data requirements in json file? #1

Closed mathieuboudreau closed 5 years ago

mathieuboudreau commented 5 years ago

Is this already possible? I haven't been able to find a way to do so. e.g. if I have multiple data files to download, I'd prefer to keep them all in the same data file instead of having multiple *.json file.

I imaging it should handle a json that somewhat look like:

{
  "inversion_recovery": {
    "src": "https://osf.io/ezv74/download/",
    "dst": "./",
    "projectName": "ir_dataset",
    "recursive": true
  },
  "vfa": {
    "src": "https://osf.io/wj6eg/download/",
    "dst": "./",
    "projectName": "vfa_dataset",
    "recursive": true
  }
}
mathieuboudreau commented 5 years ago

And then, maybe have a CLI flag that lets you select only one of those in that file to download.

e.g. repo2data -r ir_dataset.json -s inversion_recovery

ltetrel commented 5 years ago

It is not yet possible, but it would be a nice improvement ! Is it for the osf data ?

ltetrel commented 5 years ago

We would need a mechanism to detect that there is indeed multiple fields to download them one by one.. I will look into it,

mathieuboudreau commented 5 years ago

It is not yet possible, but it would be a nice improvement ! Is it for the osf data ?

Yeah, for my application, my files are split up in different OSF zips. I just thought it might be a good functionality to have in general, since other people might have similar situations. It would be cleaner than to call repo2data multiple times in a Dockerfile (e.g. my application), and simpler than writing a shell script like I did:

https://github.com/qMRLab/t1_book/blob/31831886d9873f16840305d0bffabbdef3398d04/Dockerfile#L75

I will look into it

Thanks!

ltetrel commented 5 years ago

@mathieuboudreau the feature should work now, can you try it on this branch before I merge it? I tried it on my side but I would prefer that you review it also on your side :D

mathieuboudreau commented 5 years ago

@ltetrel works great for me on my end (MacOS 10.14.3, pip 18.1, python 3.7) ! Thanks a lot!