Commit 88025df0 authored by Jochen Klar's avatar Jochen Klar
Browse files

Add tool

parent 718305cc
#!/usr/bin/env python3
import argparse
import csv
import sys
import xml.etree.ElementTree as et
nsmap = {
'dc': '{}'
parser = argparse.ArgumentParser()
args = parser.parse_args()
writer = csv.writer(sys.stdout, delimiter=',', quotechar='"', quoting=csv.QUOTE_MINIMAL)
tree = et.parse(args.file)
root = tree.getroot()
for child in root:
uri = child.attrib['{dc}uri'.format(**nsmap)]
row = [uri] + [node.text or '' for node in child]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment