cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

download-files: download particular files only #38

Closed tiborsimko closed 4 years ago

tiborsimko commented 4 years ago

Record 1 contains 2916 files and is 2.7 TB big.

Chances are people would like to download it in batches.

Currently, cernopendata-client download-files would download everything. We need to introduce finer granularity.

The goal of this issue is to introduce a new option for download-files, called perhaps --file, which would download only one particular file:

$ cernopendata-client download-files --recid 1 --filename 105FD6D0-8B71-E011-9613-00E081791775.root

Alternatively, we could offer regexp-like matching:

$ cernopendata-client download-files --recid 1 --filename '*E011*'

which would download all files matching the given glob expression.

Alternatively, since the file order is perfectly defined in JSON, we can offer downloading by chunks, either given file number N1, or several files from file number N2 to file number N3:

$ cernopendata-client download-files --recid 1 --filenumber 13
$ cernopendata-client download-files --recid 1 --filenumber 20-29
$ cernopendata-client download-files --recid 1 --filenumber 30-39
...