aboutsummaryrefslogtreecommitdiffstats
path: root/python/ia_pdf_match.py
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-10-26 12:54:37 -0700
committerBryan Newbold <bnewbold@archive.org>2021-10-26 12:54:37 -0700
commit05bd7cbcc62588e431c5efd533189e246b2a997e (patch)
treeabcc707a451e77ea1e8c5ac9a5925b97a4bd139a /python/ia_pdf_match.py
parentf3f424e42f2f4f383103cf80b30a00cfa6cfc179 (diff)
downloadsandcrawler-05bd7cbcc62588e431c5efd533189e246b2a997e.tar.gz
sandcrawler-05bd7cbcc62588e431c5efd533189e246b2a997e.zip
make fmt
Diffstat (limited to 'python/ia_pdf_match.py')
-rwxr-xr-xpython/ia_pdf_match.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/python/ia_pdf_match.py b/python/ia_pdf_match.py
index 137110c..c3d9c16 100755
--- a/python/ia_pdf_match.py
+++ b/python/ia_pdf_match.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-
"""
Input is IA item metadata JSON.
Ouput is insertable fatcat "match" JSON
@@ -81,21 +80,23 @@ def parse(obj):
'size': int(pdf_file['size']),
'mimetype': 'application/pdf',
'urls': [
- "https://archive.org/download/{}/{}".format(
- obj['metadata']['identifier'],
- pdf_file['name']),
+ "https://archive.org/download/{}/{}".format(obj['metadata']['identifier'],
+ pdf_file['name']),
],
'cdx': [],
'dois': [],
}
if extid_type == 'doi':
- match['dois'] = [extid,]
+ match['dois'] = [
+ extid,
+ ]
else:
match[extid_type] = extid
return match
+
def run():
for line in sys.stdin:
if not line:
@@ -105,5 +106,6 @@ def run():
if match:
print(json.dumps(match, sort_keys=True))
+
if __name__ == '__main__':
run()