- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
Latest commit
executable file
·31 lines (25 loc) · 841 Bytes
/
Copy pathexample.py
File metadata and controls
executable file
·31 lines (25 loc) · 841 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
#!/usr/bin/env python
from __future__ importdivision
importoptparse
importos
importsys
importdwca
importjson
importpprint
parser=optparse.OptionParser()
parser.add_option("-f", "--file", help="DWC-a file to read")
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't print status messages to stdout")
(options, args) =parser.parse_args()
ifoptions.file==None:
parser.print_help()
sys.exit(1)
else:
dwcaobj=dwca.Dwca(options.file)
forrecordindwcaobj.core:
print(json.dumps(record,separators=(',',':')))
fordwcrfindwcaobj.extensions:
forrecordindwcrf:
print(json.dumps(record,separators=(',',':')))
print(json.dumps(dwcaobj.metadata,separators=(',',':')))