Project:ZenodoDocumentation: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 17: | Line 17: | ||
= Updating code = | = Updating code = | ||
The importer source code can be found and modified in the GitHub repository [https://github.com/MaRDI4NFDI/docker-importer here]. | |||
to modify a zenodo resource (eg. add/modify properties): modify the code in | to modify a zenodo resource (eg. add/modify properties): modify the code in | ||
<code>/mardi_importer/mardi_importer/publications/ZenodoResource.py</code> | <code>/mardi_importer/mardi_importer/publications/ZenodoResource.py</code> | ||
to change how queries to the zenodo API are run, modify the code in | to change how queries to the zenodo API are run, modify the code in<syntaxhighlight lang="bash"> | ||
/mardi_importer/mardi_importer/zenodo/ZenodoSource.py | |||
</syntaxhighlight> | |||
Revision as of 12:40, 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
The importer source code can be found and modified in the GitHub repository here.
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
/mardi_importer/mardi_importer/zenodo/ZenodoSource.py