Project:ZenodoDocumentation: Difference between revisions
From MaRDI portal
Created page with " = Execution = execute the import.py script in the scripts folder <code>python3</code> <code>import.py --mode zenodo</code> the importer can be run with one or more of the following optional arguments: * communities: List[str] : a list of zenodo community IDs * resourceTypes: List[str]: a list of zenodo resource types (check here <nowiki>https://help.zenodo.org/guides/search/</nowiki> for valid values) * orcid_id_file: str: path to a file contianing information about t..." |
No edit summary |
||
| Line 1: | Line 1: | ||
= Overview = | |||
The Zenodo importer retrieves metadata for Zenodo items in json format using the [https://developers.zenodo.org/#representation35 API], parses them, and upload them to the MaRDI portal. | |||
= Execution = | = Execution = | ||
Execute the import.py script in the scripts folder: | |||
<code>python3</code> <code>import.py --mode zenodo</code> | <code>python3</code> <code>import.py --mode zenodo</code> | ||
The importer can be run with one or more of the following optional arguments: | |||
* communities: List[str] : a list of zenodo community IDs | * communities: List[str] : a list of zenodo community IDs | ||
| Line 9: | Line 12: | ||
* orcid_id_file: str: path to a file contianing information about the authors. must contain a column ‘orcid’ | * orcid_id_file: str: path to a file contianing information about the authors. must contain a column ‘orcid’ | ||
* customQ: str: see here <nowiki>https://help.zenodo.org/guides/search/</nowiki> how to build a custom query | * customQ: str: see here <nowiki>https://help.zenodo.org/guides/search/</nowiki> how to build a custom query | ||
The arguments can currently directly be modified from the import.py script as parameters to the function ZenodoSource() | |||
!!!! note: is it better to have these as a config file passed as a parameter to the importer script or is it fine to add the params inside the import script | |||
= Updating code = | |||
to modify a zenodo resource (eg. add/modify properties): modify the code in | |||
<code>/mardi_importer/mardi_importer/publications/ZenodoResource.py</code> | |||
to change how queries to the zenodo API are run, modify the code in | |||
Revision as of 11:18, 12 March 2025
Overview
The Zenodo importer retrieves metadata for Zenodo items in json format using the API, parses them, and upload them to the MaRDI portal.
Execution
Execute the import.py script in the scripts folder:
python3import.py --mode zenodo
The importer can be run with one or more of the following optional arguments:
- communities: List[str] : a list of zenodo community IDs
- resourceTypes: List[str]: a list of zenodo resource types (check here https://help.zenodo.org/guides/search/ for valid values)
- orcid_id_file: str: path to a file contianing information about the authors. must contain a column ‘orcid’
- customQ: str: see here https://help.zenodo.org/guides/search/ how to build a custom query
The arguments can currently directly be modified from the import.py script as parameters to the function ZenodoSource()
!!!! note: is it better to have these as a config file passed as a parameter to the importer script or is it fine to add the params inside the import script
Updating code
to modify a zenodo resource (eg. add/modify properties): modify the code in
/mardi_importer/mardi_importer/publications/ZenodoResource.py
to change how queries to the zenodo API are run, modify the code in