Skip to content

Commit

Permalink
Merge pull request #9 from ror-community/20231110_data_update
Browse files Browse the repository at this point in the history
Updating data and mapping script for Zenodo changes
  • Loading branch information
adambuttrick authored Nov 11, 2023
2 parents 9c3d6c4 + 58f3c31 commit a8905a8
Show file tree
Hide file tree
Showing 12 changed files with 63,069 additions and 31,317 deletions.
4,570 changes: 2,302 additions & 2,268 deletions data/aggregate_mapped.csv

Large diffs are not rendered by default.

19,042 changes: 13,367 additions & 5,675 deletions data/aggregate_unmapped.csv

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/crossref_funders.json

Large diffs are not rendered by default.

Binary file modified data/crossref_overlap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion data/datacite_funders.json

Large diffs are not rendered by default.

Binary file modified data/datacite_overlap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48,180 changes: 45,801 additions & 2,379 deletions data/funders.json

Large diffs are not rendered by default.

22,566 changes: 1,578 additions & 20,988 deletions data/members.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/ror_funder_registry_mapping.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"DataCite - Aggregrate overlap": DataCite_view
}

funder_registry_version = '1.52'
ror_registry_version = '1.33'
works_count_date = '2023/09/28'
funder_registry_version = '1.54'
ror_registry_version = '1.36'
works_count_date = '2023/11/11'

def main():
sidebar_title = st.sidebar.title("Views")
Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
altair==5.0.1
attrs==23.1.0
beautifulsoup4==4.12.2
blinker==1.6.2
cachetools==5.3.1
certifi==2023.5.7
Expand All @@ -13,9 +14,11 @@ gitdb==4.0.10
GitPython==3.1.31
idna==3.4
importlib-metadata==6.7.0
importlib-resources==6.1.1
Jinja2==3.1.2
jsonschema==4.17.3
kiwisolver==1.4.4
lxml==4.9.3
markdown-it-py==3.0.0
MarkupSafe==2.1.3
matplotlib==3.7.1
Expand All @@ -38,6 +41,7 @@ requests==2.31.0
rich==13.4.2
six==1.16.0
smmap==5.0.0
soupsieve==2.5
streamlit==1.24.0
tabulate==0.9.0
tenacity==8.2.2
Expand Down
12 changes: 11 additions & 1 deletion utilities/create_funder_id_mapping_w_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
import os


import os
import requests
import zipfile

def download_and_unzip(record_id, path='.'):
# Downloading the record from Zenodo
response = requests.get(f'https://zenodo.org/api/records/{record_id}')
record = response.json()
download_link = record['files'][0]['links']['self']
Expand All @@ -16,9 +21,14 @@ def download_and_unzip(record_id, path='.'):
with open(file_path, 'wb') as out_file:
for chunk in response.iter_content(chunk_size=1024):
out_file.write(chunk)
extracted_file_names = []
with zipfile.ZipFile(file_path, 'r') as zip_ref:
zip_ref.extractall(path)
return file_name.split('.zip')[0]
extracted_file_names = zip_ref.namelist()
if extracted_file_names:
return os.path.splitext(extracted_file_names[0])[0]
return None



def create_mapping_and_output_json(ror_data_file, json_output_file):
Expand Down

0 comments on commit a8905a8

Please sign in to comment.