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-record #2

Closed tiborsimko closed 5 years ago

tiborsimko commented 5 years ago

Goal: Implement get-record CLI function to fetch some wanted record metadata.

Inputs: --recid or --doi ot --title (useful for CMS datasets). One of them should be required.

Outputs: Full JSON of the bibliographic record.

Optionally, if some CLI switch is used, output only that JSON subtree.

Examples:

$ cernopendata-client get-record --recid 14
$ cernopendata-client get-record --doi 10.7483/OPENDATA.ATLAS.AHKR.A3TA
$ cernopendata-client get-record --recid 14 --output-fields title,date_created
$ cernopendata-client get-record --tile '/Mu/Run2010B-v1/RAW' --output-fields recid

Exit status: 0 if OK, 1 if more then one record was matched. (Should not happen.)