magpub.utils

Django-agnostic publication utilities.

Contains BibTeX parsing helpers, text normalization, similarity checks, and publication type inference.

Functions

decode_unicode_text(text)

Replace unicode characters with equivalent ASCII characters.

format_author_name(author)

Convert 'Last, First' into 'First Last'.

get_forum(bibtex_entry)

Build a comma-separated forum string from BibTeX fields.

get_link(bibtex_entry)

Extract a URL from a BibTeX entry dictionary.

get_month(bibtex_entry)

Extract a numeric month from a BibTeX entry dictionary.

get_pub_type(bibtex_entry)

Infer the canonical publication type from a BibTeX entry dictionary.

get_pub_type_from_str(value[, bibtex_source])

Normalize a plain-string publication type (e.g. from a UI dropdown).

how_similar(str1, str2)

Return difflib.SequenceMatcher ratio between two strings.

is_pub_similar(pub1, pub2)

Return True if two publications are likely duplicates.