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

cli: `get-file-locations --verbose` #83

Closed tiborsimko closed 3 years ago

tiborsimko commented 3 years ago

Currently, we output only file locations when users use the get-file-locations command:

$ cernopendata-client get-file-locations --recid 1 | head -3
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/00E16FBB-9071-E011-83D3-003048673F12.root
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/0248915F-EE71-E011-8894-0025902009E8.root
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/0268F635-B671-E011-9090-002481E14E00.root

This does not inform users about the size or the checksum of what is going to be uploaded.

This information could be useful to estimate the download times and/or to plug this into automated scripts the users may have.

In order to improve the situation, we can introduce a new option --verbose (or perhaps two new options --include-size and --include-chechksum?) that would also print out the file size and the checksum information.

Example:

$ cernopendata-client get-file-locations --recid 1 | head -3
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/00E16FBB-9071-E011-83D3-003048673F12.root 123234234234 adler32:aaaaa
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/0248915F-EE71-E011-8894-0025902009E8.root 234234324 adler32:bbbbb
http://opendata.cern.ch/eos/opendata/cms/Run2010B/BTau/AOD/Apr21ReReco-v1/0000/0268F635-B671-E011-9090-002481E14E00.root 67676767676 adler32:ccccc

I.e. the output would be space-separated URI SIZE CHECKSUM triad.

CC @jbenito3