Skip to content

Commit

Permalink
migrator: update funders dump script
Browse files Browse the repository at this point in the history
  • Loading branch information
slint committed Sep 19, 2023
1 parent d76eee3 commit 0664dda
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions migrator/scripts/dump_funders_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"""

import csv
import json
import orjson as json
import uuid

from idutils import normalize_ror
from invenio_rdm_migrator.utils import ts

DATA_PATH = "v1.25-2023-05-11-ror-data.zip" # https://zenodo.org/record/7926988
DATA_PATH = "v1.32-2023-09-14-ror-data.zip" # https://zenodo.org/record/8346986


VOCABULARIES_FUNDER_SCHEMES = {
"grid",
Expand Down Expand Up @@ -72,7 +73,7 @@ def load_file(datafile, outpath):
with open(outpath, "w") as fout, open(datafile, "rb") as fp:
print(f"[{ts()}] loading {datafile}")
writer = csv.writer(fout)
entries = json.load(fp)
entries = json.loads(fp.read())
for idx, data in enumerate(entries):
if idx % 1000 == 0:
print(f"[{ts()}] {idx}")
Expand Down

0 comments on commit 0664dda

Please sign in to comment.