Changeset View
Changeset View
Standalone View
Standalone View
swh/deposit/utils.py
Show All 11 Lines | |||||
from swh.model.identifiers import SWHID, normalize_timestamp, parse_swhid | from swh.model.identifiers import SWHID, normalize_timestamp, parse_swhid | ||||
from swh.model.model import MetadataTargetType | from swh.model.model import MetadataTargetType | ||||
def parse_xml(stream, encoding="utf-8"): | def parse_xml(stream, encoding="utf-8"): | ||||
namespaces = { | namespaces = { | ||||
"http://www.w3.org/2005/Atom": None, | "http://www.w3.org/2005/Atom": None, | ||||
"http://www.w3.org/2007/app": "app", | "http://www.w3.org/2007/app": "app", | ||||
"http://purl.org/dc/terms/": None, | "http://purl.org/dc/terms/": "dc", | ||||
"https://doi.org/10.5063/SCHEMA/CODEMETA-2.0": "codemeta", | "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0": "codemeta", | ||||
"http://purl.org/net/sword/terms/": "sword", | "http://purl.org/net/sword/terms/": "sword", | ||||
"https://www.softwareheritage.org/schema/2018/deposit": "swh", | "https://www.softwareheritage.org/schema/2018/deposit": "swh", | ||||
} | } | ||||
data = xmltodict.parse( | data = xmltodict.parse( | ||||
stream, encoding=encoding, namespaces=namespaces, process_namespaces=True | stream, encoding=encoding, namespaces=namespaces, process_namespaces=True | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines |