adsfolio.bibtex.parser

BibTeX parsing utilities.

adsfolio.bibtex.parser.extract_cite_keys(tex_file)[source]

Extract citation keys from a LaTeX file.

Parameters:

tex_file (str or Path) – Path to the LaTeX file.

Returns:

List of unique bibcode-style citation keys (19 characters, year prefix).

Return type:

list[str]

adsfolio.bibtex.parser.make_rawfile(bibtex_text, output_file)[source]

Create a summary file from BibTeX.

Write one line per entry whose key is a 19-character bibcode:

bibcode  # author_summary || title

Entries are read with parse_bibtex_entries, so single-line entries, nested braces, and quoted or multiline fields are supported. The author summary is the sole surname, surnames joined by +, or the first surname plus +N when there are more than three authors.

Parameters:
  • bibtex_text (str) – BibTeX content.

  • output_file (str or Path) – Output file path, written as UTF-8.

Return type:

None

adsfolio.bibtex.parser.parse_bibtex_entries(bibtex_text)[source]

Parse BibTeX text into structured entries.

Parameters:

bibtex_text (str) – Raw BibTeX content.

Returns:

Parsed BibTeX entries.

Return type:

list[BibEntry]