try: import zenodo except ImportError: from langsci import zenodo """ usage: > python3 zenodo.py 7 The script looks for all include'd files from the folder chapters/ in main.tex It will ignore the first n files, where n is the argument of the script If no argument is given, processing will start with the first file. For each file, the script will extract metadata from the file itself and from the file collection_tmp.bib generated by biber. The metadata is collected and a corresponding entry is created on Zenodo. The DOI assigned by Zenodo is collected and inserted into the file. """ book = zenodo.Book() # for c in book.chapters: # pprint.pprint(c.metadata) try: tokenfile = open("zenodo.token") except FileNotFoundError: print( "Token file not found. Please create a file 'zenodo.token', which must be readable.\nExiting" ) raise SystemExit token = open("zenodo.token").read().strip() tokenfile.close() # print(token) # bookdoi = book.register(token) # print("BookDOI{%s}"%bookdoi) offset = 0
The metadata is collected and a corresponding entry is created on Zenodo. The DOI assigned by Zenodo is collected and inserted into the file. """ offset = 0 try: offset = int(sys.argv[1]) except IndexError: pass extracommunities = [] try: extracommunities = int(sys.argv[2]) except IndexError: pass book = zenodo.Book(extracommunities=extracommunities, glottolog=glottolog) # for c in book.chapters: # pprint.pprint(c.metadata) try: tokenfile = open("zenodo.token") except FileNotFoundError: print( "Token file not found. Please create a file 'zenodo.token', which must be readable.\nExiting" ) raise SystemExit token = open("zenodo.token").read().strip() tokenfile.close() # print(token) # bookdoi = book.register(token) # print("BookDOI{%s}"%bookdoi)
The metadata is collected and a corresponding entry is created on Zenodo. The DOI assigned by Zenodo is collected and inserted into the file. """ offset = 0 try: offset = int(sys.argv[1]) except IndexError: pass extracommunities = [] try: extracommunities = int(sys.argv[2]) except IndexError: pass book = zenodo.Book(extracommunities=extracommunities) # for c in book.chapters: # pprint.pprint(c.metadata) try: tokenfile = open("zenodo.token") except FileNotFoundError: print( "Token file not found. Please create a file 'zenodo.token', which must be readable.\nExiting" ) raise SystemExit token = open("zenodo.token").read().strip() tokenfile.close() # print(token) # bookdoi = book.register(token) # print("BookDOI{%s}"%bookdoi)