Skip to content
Snippets Groups Projects
Commit 91045ff0 authored by Hartmut Beyer's avatar Hartmut Beyer :penguin:
Browse files

Dokumentation: json statt pickle

parent 3ae761f1
No related branches found
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment