From 008af18288deb813526e1d9612b349f660d089de Mon Sep 17 00:00:00 2001
From: Elias Chetouane <elias.chetouane@univ-grenoble-alpes.fr>
Date: Fri, 16 Feb 2024 18:09:45 +0100
Subject: [PATCH] Correction de bug : ajout d'infos sur les clients datacite.

---
 1-enrich-with-datacite/concatenate-enrich-dois.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/1-enrich-with-datacite/concatenate-enrich-dois.py b/1-enrich-with-datacite/concatenate-enrich-dois.py
index 7a0e8b1..15786a2 100644
--- a/1-enrich-with-datacite/concatenate-enrich-dois.py
+++ b/1-enrich-with-datacite/concatenate-enrich-dois.py
@@ -60,14 +60,15 @@ if temp_rows :
 	print(f"\n\nnb of doi exported \t{len(df_out)}")
 
 	## output another csv with datacite client and number of datasets
-	df_client_raw = df_out["client"].value_counts()
+	df_client_raw = df_out["client"].value_counts().to_frame()
 
 	## get informations about each client
 	client_names = []
 	client_years = []
 	client_urls = []
-	for client in df_client_raw["client"]:
-		req = requests.get('https://api.datacite.org/clients?query=id:%22cern.zenodo%22')
+	for i in range(0, len(df_client_raw)):
+		client = df_client_raw.iloc[i].name
+		req = requests.get('https://api.datacite.org/clients?query=id:%22'+str(client)'%22')
 		client_names.append(req.json()["data"][0]["attributes"]["name"])
 		client_years.append(req.json()["data"][0]["attributes"]["year"])
 		client_urls.append(req.json()["data"][0]["attributes"]["url"])
-- 
GitLab