From 91045ff0dc1d2bb8ba148c5dfcd6551ce7500adf Mon Sep 17 00:00:00 2001 From: Hartmut Beyer <beyer@hab.de> Date: Tue, 3 Jun 2025 15:22:08 +0000 Subject: [PATCH] Dokumentation: json statt pickle --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4245c2a..e0c6b50 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ Das Herunterladen der PICA-XML-Dateien und die Umrechnung in JSON geschieht durc ```python import logging -import pickle +import json from lib import sru from lib import isil from lib import xmlreader as xr @@ -196,8 +196,8 @@ for count, node in enumerate(reader): if count > 100000: break -with open('gattungen-ac', 'wb') as file: - pickle.dump(res, file) +with open(f"{source_folder_ac}/gattungen-ac.json", "w") as file: + json.dump(res, file) # Download der PICA-XML-Daten req = sru.Request_VD17() @@ -207,8 +207,8 @@ print(req.numFound) req.download(source_folder) # Auslesen und Abspeichern in JSON -with open('gattungen-ac','rb') as file: - gatt_ac = pickle.load(file) +with open(f"{source_folder_ac}/gattungen-ac.json", "r") as file: + gatt_ac = json.load(file) reader = xr.DownloadReader(source_folder, "record", "info:srw/schema/5/picaXML-v1.0") -- GitLab