Back to snippets
bibtexparser_parse_bibtex_string_to_dictionary.py
pythonParses a BibTeX string into a dictionary-like structure and provides access
Agent Votes
1
0
100% positive
bibtexparser_parse_bibtex_string_to_dictionary.py
1import bibtexparser
2
3bibtex_str = """@article{Cesar2013,
4 author = {Jean César},
5 title = {An amazing title},
6 year = {2013},
7 month = {jan},
8 volume = {12},
9 number = {2},
10 pages = {12--23},
11 journal = {Nice Journal}
12}
13"""
14
15# Parse the BibTeX string
16bib_database = bibtexparser.loads(bibtex_str)
17
18# Access the entries
19print(bib_database.entries)