from pybib import JournalList, BibtexBibliography from matplotlib import pyplot as plt import numpy as np bb = BibtexBibliography() bb.read_db() histogram_dict = {} for entry in bb.database: try: abbr = entry['journal_abbreviated'] except: pass if abbr in histogram_dict.keys(): histogram_dict[abbr] = histogram_dict[abbr] + 1 else: histogram_dict[abbr] = 1 labels = histogram_dict.keys() counts = [] for label in labels: counts.append(histogram_dict[label]) idx_vec = np.argsort(counts)[::-1] counts = [counts[idx] for idx in idx_vec] labels = [labels[idx] for idx in idx_vec] fig = plt.figure(figsize=(20, 5)) ax = plt.axes()
from pybib import JournalList, BibtexBibliography build_journal_db = False if build_journal_db: jlist = JournalList() jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR, 'isi_html.csv')) jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR, 'jlist.csv')) jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR, 'additions.csv'), True) jlist.write_db(False) bb = BibtexBibliography() rebuild = False if rebuild: bb.populate_from_bibtex(BIBTEX_FILENAME) bb.remove_brackets() bb.remove_newlines() bb.replace_strings(TITLE_KEY_FILENAME) bb.clean_journal_titles(debug=False) bb.fix_tag_logic(debug=False) bb.fix_title_case(debug=False) bb.write_db() bb.read_db() print bb.to_bibtex(abbreviated=True)
from pybib import JournalList,BibtexBibliography from matplotlib import pyplot as plt import numpy as np bb = BibtexBibliography() bb.read_db() histogram_dict = {} for entry in bb.database: try: abbr = entry['journal_abbreviated'] except: pass if abbr in histogram_dict.keys(): histogram_dict[abbr] = histogram_dict[abbr]+1 else: histogram_dict[abbr] = 1 labels = histogram_dict.keys() counts = [] for label in labels: counts.append(histogram_dict[label]) idx_vec = np.argsort(counts)[::-1] counts = [counts[idx] for idx in idx_vec] labels = [labels[idx] for idx in idx_vec]
from pybib import JournalList,BibtexBibliography build_journal_db = False if build_journal_db: jlist = JournalList() jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR,'isi_html.csv')) jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR,'jlist.csv')) jlist.populate_from_csv(os.path.join(JOURNAL_LIST_DIR,'additions.csv'),True) jlist.write_db(False) bb = BibtexBibliography() rebuild = False if rebuild: bb.populate_from_bibtex(BIBTEX_FILENAME) bb.remove_brackets() bb.remove_newlines() bb.replace_strings(TITLE_KEY_FILENAME) bb.clean_journal_titles(debug=False) bb.fix_tag_logic(debug=False) bb.fix_title_case(debug=False) bb.write_db() bb.read_db() print bb.to_bibtex(abbreviated=True)