1
0

initial import of material for public archive into git

We're creating a fresh archive because the history for our old chapter includes
API keys, data files, and other material we can't share.
This commit is contained in:
2018-01-21 17:15:51 -08:00
commit dd420c77de
41 changed files with 7069 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import argparse
from request_functions import *
'''
This script takes in a search query and an output file. It queries the scopus API to find all papers that match the search query, and saves them to the output file.
Unlike some of the other scripts in this directory, it does not try to determine the state - if you restart the script, it will start over and blow away whatever you had saved before.
'''
years = range(2004, 2017)
def main():
parser = argparse.ArgumentParser(description='Output JSON of all articles matching search query')
parser.add_argument('-q', help='Search query', required=True)
parser.add_argument('-o', help='Where to append JSON results')
args = parser.parse_args()
with open(args.o, 'w') as out_file:
for year in years:
get_search_results(args.q, out_file, year=year)
if __name__ == '__main__':
main()