Created
April 26, 2014 13:17
-
-
Save Phyks/11319857 to your computer and use it in GitHub Desktop.
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
def parsed2Bibtex(parsed): | |
""" | |
Convert a single bibtex entry dict to bibtex string | |
""" | |
data = parsed.get_entry_dict() | |
bibtex = '' | |
for entry in data.keys(): | |
bibtex += '@'+data[entry]['type']+'{'+data[entry]['id']+",\n" | |
for field in [i for i in sorted(data[entry]) if i not in ['type', 'id']]: | |
bibtex += "\t"+field+"={"+data[entry][field]+"},\n" | |
bibtex += "}\n\n" | |
return bibtex | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment