forked from KBNLresearch/KB-python-API
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
32 lines (23 loc) · 837 Bytes
/
Copy pathexample.py
File metadata and controls
32 lines (23 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from kb.nl.api import sru
from kb.nl.api import oai
from kb.nl.helpers import alto_to_text
oai_handler = oai
oai_handler.current_set = "ANP"
response = sru.search("beatrix AND juliana AND Bernhard AND telegram", "ANP")
print "Number of records: %i" % response.sru.nr_of_records
record_nr = 0
for record in response.records:
record_nr += 1
print("********~ Record number %i ~*********" % record_nr)
print("Date: %s" % record.date)
print("RecordIdentifier: %s" % record.identifier)
print("Abstract: %s" % record.abstract)
print("Title: %s" % record.title)
record = oai_handler.get(record.identifier)
for alto in record.alto:
print("Fulltext: %s" % alto_to_text(alto))
print("*************************************\n\n")