Last active
June 5, 2019 20:48
-
-
Save mattpitkin/7834c802be6264634c695cf5dc4a1e7a to your computer and use it in GitHub Desktop.
Get my publication from ADS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ads | |
query = 'pubdate:[2003-01 TO 9999-12] author:("Pitkin, M")' | |
maxpubs = 500 | |
papers = ads.SearchQuery(q=query, rows=maxpubs, property='article') | |
titleexclusions = ["Erratum", "ERRATUM", "Publisher's Note"] | |
to_retrieve = set() | |
for paper in papers: | |
exclude = False | |
title = paper.title[0] | |
for te in titleexclusions: | |
if te in title: | |
exclude = True | |
break | |
if not exclude: | |
to_retrieve.add(paper.bibcode) | |
# get bibtex | |
bibtexs = ads.ExportQuery(list(to_retrieve), 'bibtex').execute() | |
# write out bibtex | |
with open('my_pubs.bib', 'w') as fp: | |
fp.write(bibtexs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment