-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathURN.py
40 lines (27 loc) · 903 Bytes
/
URN.py
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
33
34
35
36
37
38
39
40
## Bibliotheken:
import streamlit as st
import requests
from IPython.display import display, clear_output
from bs4 import BeautifulSoup
from lxml import etree
import pandas
import unicodedata
from IPython.core.display import display, HTML
import xmltodict
st.header("Test - Informationen zu URNs")
st.write("Hier können Sie sich Informationen zu einer URN aus dem Namensraum urn:nbn:de anzeigen lassen.")
urn = st.text_input('gesuchte URN')
#testurn: urn:nbn:de:hebis:26-opus-37188
xml_url = "https://nbn-resolving.org/xml/"
json_url = "https://nbn-resolving.org/json/"
xmlrequest = xml_url + urn
st.write(xmlrequest)
def query(urn):
response = requests.get(xmlrequest)
return response
test = query(urn)
data = test.content
data2 = xmltodict.parse(test.content)
st.code(test)
st.code(data)
st.code(data2)