Package: push2HAL
push2HALis a basic Python library dedicated to data uploading onHALdatabase. It will use the classical API of HAL to get information and the SWORD one to upload content. Two main executables are provided (for UNIX use only):pdf2halis able to upload a PDF file to an existing notice on HAL (only with valid permission to modify it).json2halis able to build the necessary data from a JSON file to create a new notice in HAL and upload it directly with or without providing a PDF file.pdf2hal- Upload PDF file to an existing notice in HALpdf2halproposes an interactive mode to upload a PDF to the right/selected notice in HAL by extracting basic data from the PDF file and executing a search on HAL databaseUsage:usage: pdf2hal [-h] [-a HALID] [-c CREDENTIALS] [-v] [-e] [-l LOGIN] [-p PASSWD] [-f] pdf_pathArgumentspositional argument:pdf_pathPath to the PDF fileoptional arguments:shortlongdefaulthelp-h--helpshow this help message and exit-a--halidNoneHALid of document to update-c--credentialsNonePath to the credentials file-v--verboseShow all logs-e--prodExecute on production server (use with caution)-t--testExecute on prod server as test (dryrun)-l--loginNoneUsername for API (HAL)-p--passwdNonePassword for API (HAL)-cc--completeNoneRun completion (use grobid, idext or affiliation or list of terms separated by comma)-id--idhalNoneidHal to link deposit to specific userjson2hal- Create a new note on HAL w/- or w/o additional filejson2halis able to create a note on HAL based on content provided in a JSON file. Additional (PDF) could be provided and uploaded on the same timeUsage:usage: json2hal [-h] [-c CREDENTIALS] [-v] [-e] [-t] [-l LOGIN] [-p PASSWD] [-cc COMPLETE] [-id IDHAL] json_pathArgumentspositional argument:json_pathPath to the JSON fileoptional arguments:shortlongdefaulthelp-h--helpshow this help message and exit-c--credentialsNonePath to the credentials file-v--verboseShow all logs-e--prodExecute on production server (use with caution)-t--testExecute on prod server as test (dryrun)-l--loginNoneUsername for API (HAL)-p--passwdNonePassword for API (HAL)-cc--completeNoneRun completion (use grobid, idext or affiliation or list of terms separated by comma)-id--idhalNoneidHal to link deposit to specific userNote that:HAL credentials (for production or pre-production server) could be provided using.apihalbased on JSON syntax (see.apihal_example)by default, thepreprod serveris used (argument-euse theproduction server)a test mode on production server could be used by give argument-tInstallationpush2HALcould be installed directly fromPyPIusingpip install push2HALIn addition, download this repository and runpip install .in the root folder of it.ExamplesFolderExamplescontains basic example files such as:.apihal_exampleis a credentials example file that must be edited, renamed as.apihaland located in the current working directory or in the same directory as the argument file forpdf2halorjson2hal.file.pdfthat can be used withpdf2halfor testing the behavior of the command:pdf2hal file.pdftest_comments.jsoncontains a detailed version of the JSON file that can be used withjson2hal. It contains all the possible fields of the input JSON file with basic comments. This file can not be used directly withjson2hal(usetest.jsonin place).test.jsonis a working JSON file that can be used withjson2hal:json2hal test.json.ReferencesThe tools have been developed by considering documentation:SWORD implementation in HALXSD validation format for HALXML integration documentation for HALcommon XML files for HALHAL referentialHAL API syntax for searchingTodoCreatexml2halcliAdd the possibility to usepdf2halonly for finding HAL idReturn HAL document ID after creation of a new note