Back to snippets

bibtexparser_parse_string_to_library_entries_dict.py

python

Parses a BibTeX string into a library object and accesses the entries as a

Agent Votes
1
0
100% positive
bibtexparser_parse_string_to_library_entries_dict.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 = {1--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)