import sys from pmc_bibtex import ArticleList alist = ArticleList() query = "(adaptive+optics)+AND+(optical+coherence+tomography)" alist.build(query) alist.to_bibtex("test.bib")
from pmc_bibtex import ArticleList from matplotlib import pyplot as plt import numpy as np alist = ArticleList() query = '(adaptive+optics)' alist.build(query,retmax=10000) years = [] bins = np.arange(2003.5,2015.6,1.0) for a in alist.article_list: y = 2016 for key in a.date_dict.keys(): y_c = a.date_dict[key].year if y_c<y: y = y_c if 2004<=y<=2015: years.append(y) plt.hist(years,bins) plt.show()
import sys from pmc_bibtex import ArticleList alist = ArticleList() query = '(adaptive+optics)+AND+(optical+coherence+tomography)' alist.build(query) alist.to_bibtex('test.bib') sys.exit() bibtex_fid = open('pmc_aooct.bib','wb') with open('aooct_citations.csv','wb') as f: writer = csv.writer(f) for id in idlist: id = id[4:-5] print id xml = fetch(id) art = xml2article(xml) match = art.conjoint_search(['adaptive optics','optical coherence tomography']) include_fn = os.path.join('.','xml','%s.xml.include'%id) if not match: include_fid = open(include_fn,'wb') include_fid.write('0') include_fid.close() print 'No match.' continue try: include_fid = open(include_fn,'rb') include = bool(include_fid.read()) include_fid.close()