CLI Commands¶
The command line interface (CLI) allows certain management commands to be run on the command line. In addition to the commands below, you can also invoke invenio and flask CLI commands using the hepdata binary.
hepdata importer¶
Import from HepData website to a local instance.
Usage
hepdata importer [OPTIONS] COMMAND [ARGS]...
bulk-import-records¶
Populate the DB with records from HEPData.net (or another instance as specified by base_url)
Usage: hepdata importer bulk-import-records -u true -d 2020-01-01
Usage
hepdata importer bulk-import-records [OPTIONS]
Options
- -d, --date <date>¶
Filter all records modified since some point in time, e.g. 2016-07-05 for the 5th July 2016.
- -u, --update-existing <update_existing>¶
Whether to update records which already exist(defaults to False)
- -a, --allow-old-schema <allow_old_schema>¶
Whether to allow a fall back to validation against the old schema(defaults to True)
- -b, --base-url <base_url>¶
Base URL from which to get data (defaults to https://hepdata.net)
- -n, --n-latest <n_latest>¶
Get only the n most recently updated records
- -e, --send-email <send_email>¶
Whether or not to send emails on finalising submissions
- -i, --ids-url <ids_url>¶
URL of a JSON file containing a list of INSPIRE IDs (e.g. https://example.com/hepdata/inspire.json). When given, –base-url and –date are ignored for ID retrieval.
- -f, --files-url <files_url>¶
Base URL for downloading submission files. When given, files are fetched using the pattern {files_url}/ins{inspire_id}.tar.gz instead of the default HEPData download endpoint.
- -c, --coordinator-id <coordinator_id>¶
User ID to assign as Coordinator (defaults to 1)
import-records¶
Populate the DB with specific records from HEPData.net (or another instance as specified by base_url)
Usage: hepdata importer import-records -i 'ins1262703' -rc False
Usage
hepdata importer import-records [OPTIONS]
Options
- -i, --inspireids <inspireids>¶
A comma separated list of recids to load.
- -rc, --recreate_index <recreate_index>¶
Whether or not to recreate the index before importing(defaults to False)
- -u, --update-existing <update_existing>¶
Whether to update records which already exist(defaults to False)
- -a, --allow-old-schema <allow_old_schema>¶
Whether to allow a fall back to validation against the old schema(defaults to True)
- -b, --base-url <base_url>¶
Base URL from which to get data (defaults to https://hepdata.net)
- -e, --send-email <send_email>¶
Whether or not to send emails on finalising submissions
- -c, --coordinator-id <coordinator_id>¶
User ID to assign as Coordinator (defaults to 1)
- -f, --files-url <files_url>¶
Base URL for downloading submission files. When given, files are fetched using the pattern {files_url}/ins{inspire_id}.tar.gz instead of the default HEPData download endpoint.
hepdata utils¶
Utils.
Usage
hepdata utils [OPTIONS] COMMAND [ARGS]...
clean-remaining-files¶
Deletes files that remain in data dir after cleanup and move-data-files have been run.
Usage
hepdata utils clean-remaining-files [OPTIONS]
cleanup-old-files¶
Deletes db entries and files that are no longer used
Usage
hepdata utils cleanup-old-files [OPTIONS]
create-mock-migrated-record¶
Populate the DB with a specific record which mimics a record migrated from hepdata.cedar.ac.uk. Accepts inspire ids 753951, 1299143, 1320775.
Usage: hepdata utils create-mock-migrated-record
Usage
hepdata utils create-mock-migrated-record [OPTIONS]
Options
- -i, --inspire-id <inspire_id>¶
Inspire id to import
- Options:
753951 | 1299143 | 1320775
- -e, --send-email <send_email>¶
Whether or not to send emails on finalising submissions
execute¶
Execute a SQL query via SQLAlchemy Engine.
Usage
hepdata utils execute [OPTIONS]
Options
- -q, --query <query>¶
SQL query to execute via SQLAlchemy Engine.
find-and-add-record-analyses¶
Finds analyses from tools such as Rivet, MadAnalysis 5, etc. and adds them to records.
Usage
hepdata utils find-and-add-record-analyses [OPTIONS]
Options
- -e, --endpoint <endpoint>¶
Specific endpoint to update (e.g. “rivet” or “MadAnalysis” or “SModelS” or “CheckMATE” or “HackAnalysis” or “Combine” or “GAMBIT” or “SimpleAnalysis”). Omit for all.
find-duplicates-and-remove¶
Will go through the application to find any duplicates then remove them.
Usage
hepdata utils find-duplicates-and-remove [OPTIONS]
Options
- -b, --base-url <base_url>¶
Base URL from which to get data (defaults to https://hepdata.net)
get-data-path¶
Gets the file path where data files for the given record are stored.
Usage
hepdata utils get-data-path [OPTIONS]
Options
- -r, --record-id <record_id>¶
Record id for which to get information
- -i, --inspire-id <inspire_id>¶
Inspire id for which to get information
move-data-files¶
Move data files into new data file locations. Deletes converted files for all records.
Usage
hepdata utils move-data-files [OPTIONS]
Options
- -r, --recids <recids>¶
Move data files for specific recids only.
reindex¶
Usage
hepdata utils reindex [OPTIONS]
Options
- -rc, --recreate <recreate>¶
Whether or not to recreate the index mappings as well. This DELETES the entire index first.
- -u, --update-mapping <update_mapping>¶
Whether or not to update the index mapping as well.
- -s, --start <start>¶
Starting recid for the index operation.
- -e, --end <end>¶
End recid for the index operation.
- -b, --batch <batch>¶
Number of submissions to index at a time.
send-email¶
Send finalised email announcing that records have been added or revised (in case it wasn’t done automatically).
Usage
hepdata utils send-email [OPTIONS]
Options
- -i, --inspireids <inspireids>¶
Specific Inspire IDs of records to send finalised email for.
send-tweet¶
Send tweet announcing that records have been added or revised (in case it wasn’t done automatically).
Usage
hepdata utils send-tweet [OPTIONS]
Options
- -i, --inspireids <inspireids>¶
Specific INSPIRE IDs of records to be tweeted.
unload¶
Remove records given their HEPData IDs from the database. Removes all database entries and corresponding files.
Usage
hepdata utils unload [OPTIONS]
Options
- -r, --recids <recids>¶
Unload specific recids from the system.
hepdata doi-utils¶
DOI utils.
Usage
hepdata doi-utils [OPTIONS] COMMAND [ARGS]...
register-doi¶
Register DOI for a single submission defined by the INSPIRE ID and version.
Usage
hepdata doi-utils register-doi [OPTIONS]
Options
- -i, --inspire_id <inspire_id>¶
Specify inspire id of submission to generate the DOI for.
- -v, --version <version>¶
Specify version of submission to generate the DOI for.
register-dois¶
Register DOIs for a comma-separated list of INSPIRE IDs.
Usage
hepdata doi-utils register-dois [OPTIONS]
Options
- -i, --inspire_ids <inspire_ids>¶
Specify inspire ids of submissions to generate the DOIs for.
- -s, --start_recid <start_recid>¶
Starting recid if looping over submissions.
- -e, --end_recid <end_recid>¶
End recid if looping over submissions.
register-table-dois¶
Register DOIs for a comma-separated list of table DOIs.
Usage
hepdata doi-utils register-table-dois [OPTIONS]
Options
- -t, --table_dois <table_dois>¶
Specify DOIs of individual tables.
hepdata converter¶
Converter utils.
Usage
hepdata converter [OPTIONS] COMMAND [ARGS]...
prefetch-converted-files¶
Goes through all HEPData submissions and creates their YAML, ROOT, CSV, and YODA representations. This avoids any wait time for users when trying to retrieve converted files. NOTE: Does not pre-fetch all individual files, since this would be too much and probably not necessary.
Usage
hepdata converter prefetch-converted-files [OPTIONS]
Options
- -i, --inspire_ids <inspire_ids>¶
Specify INSPIRE IDs of submissions to generate the cached files for.
- -f, --force <force>¶
Force re-creation of converted files.
- -t, --targets <targets>¶
Specify file type of conversions as comma-separated string.
hepdata submissions¶
Submissions.
Usage
hepdata submissions [OPTIONS] COMMAND [ARGS]...
reindex¶
Reindexes HEPSubmissions and adds to the submission index.
Usage
hepdata submissions reindex [OPTIONS]
write-stats-to-files¶
Writes some statistics on number of submissions per Coordinator to files.
Usage
hepdata submissions write-stats-to-files [OPTIONS]
hepdata inspire¶
INSPIRE utils to update publication information.
Usage
hepdata inspire [OPTIONS] COMMAND [ARGS]...
cli-update-all-records-info¶
Update publication information from INSPIRE for all records.
Usage
hepdata inspire cli-update-all-records-info [OPTIONS]
cli-update-record-info¶
Update publication information from INSPIRE for a specific record.
Usage
hepdata inspire cli-update-record-info [OPTIONS]
Options
- -i, --inspire_id <inspire_id>¶
Required Specify Inspire ID of record to update.
- -e, --send_email <send_email>¶
Whether or not to send email about update.
cli-update-records-info-on¶
Update publication information from INSPIRE for all records updated on a certain date.
Usage
hepdata inspire cli-update-records-info-on [OPTIONS]
Options
- -d, --date <date>¶
Required Specify date on which to update records.
cli-update-records-info-since¶
Update publication information from INSPIRE for all records updated since a certain date.
Usage
hepdata inspire cli-update-records-info-since [OPTIONS]
Options
- -d, --date <date>¶
Required Specify date since when to update records.
hepdata fix¶
Group of commands for temporary fixes, e.g. to fix issues from old migrated files, or previous bugs.
To add a new fix command, create a new module in the fixes
directory (in the same directory as the hepdata package) with a method
annotated with @fix.command().
To see the list of available fix commands, use: hepdata fix --help
Usage
hepdata fix [OPTIONS] COMMAND [ARGS]...