From 05bd7cbcc62588e431c5efd533189e246b2a997e Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 26 Oct 2021 12:54:37 -0700 Subject: make fmt --- python/ia_pdf_match.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'python/ia_pdf_match.py') 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() -- cgit v1.2.3