arxiv_metadata/main.py

27 lines
524 B
Python
Raw Normal View History

2015-12-23 19:29:10 +01:00
#!/usr/bin/env python3
import os
import sys
2015-12-23 22:18:52 +01:00
2015-12-23 22:49:14 +01:00
# Local import
import arxiv
import bbl
2015-12-23 19:29:10 +01:00
def oa_from_doi(doi):
"""
Get an OA version for a given DOI.
"""
# http://beta.dissem.in/api/10.1088/1367-2630/17/9/093036
pass
if __name__ == "__main__":
2015-12-23 22:18:52 +01:00
import pprint
2015-12-23 19:29:10 +01:00
if len(sys.argv) < 2:
2015-12-23 22:18:52 +01:00
sys.exit("Usage: " + sys.argv[0] + " BBL_FILE|ARXIV_EPRINT.")
2015-12-23 19:29:10 +01:00
2015-12-23 22:18:52 +01:00
if os.path.isfile(sys.argv[1]):
2015-12-23 22:49:14 +01:00
pprint.pprint(bbl.get_dois(sys.argv[1]))
2015-12-23 22:18:52 +01:00
else:
2015-12-23 22:49:14 +01:00
pprint.pprint(arxiv.get_dois(sys.argv[1]))