Skip to content

Commit

Permalink
#5 Updata
Browse files Browse the repository at this point in the history
store the data into a txt, and type of the data is string, looks like:
@Article{hardin2014clinical,
  title={The clinical and genetic features of COPD-asthma overlap syndrome},
  author={Hardin, Megan and Cho, Michael and McDonald, Merry-Lynn and Beaty, Terri and Ramsdell, Joe and Bhatt, Surya and Van Beek, Edwin JR and Make, Barry J and Crapo, James D and Silverman, Edwin K and others},
  journal={European Respiratory Journal},
  volume={44},
  number={2},
  pages={341--350},
  year={2014},
  publisher={Eur Respiratory Soc}
}
  • Loading branch information
HesongHuang authored Mar 24, 2017
1 parent b579534 commit bf26376
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scholar.py
Original file line number Diff line number Diff line change
Expand Up @@ -1214,14 +1214,17 @@ def csv(querier, header=False, sep='|'):
result = art.as_csv(header=header, sep=sep)
print(encode(result))
header = False

def store(data,file_name):
with open(file_name, 'w') as json_file:
json_file.write(json.dumps(data))
f1 = open(file_name,'w')
f1.write(data)
f1.close()


def citation_export(querier):
articles = querier.articles
store(querier.list,"bibtex.json")
string = ''.join(querier.list)
store(string,'Bibtex.txt') #store(querier.list,'bibtex.json')
for art in articles:
print (encode(art.as_citation()) +'\n')

Expand Down

0 comments on commit bf26376

Please sign in to comment.