torchcell.literature.generate_citation_key

generate_citation_key(creators: list[str], published: str, title: str) → str[source]

Generate a Better BibTeX-style citation key from paper metadata.

Format: {firstauthorlastname}{TitleWord}{TitleWord}...{YYYY} matching the Better BibTeX default [auth:lower][Title:skipwords:nopunct:fold:condense=''][year].

The key is a pure function of the metadata the Zotero web API returns (creators, date, title), so it reproduces identically on every run and host – the property the literature mirror relies on to key each paper’s artifact directory deterministically.

Non-ASCII author surnames and title words are transliterated to ASCII via unidecode() before stripping, so Müller yields muller rather than the lossy mller. Output is restricted to [A-Za-z0-9] and always begins with a letter (the unknown fallback guarantees it).

Examples

["John Smith"], "2022", "Biodegradation of PET" -> smithBiodegradationPET2022

Parameters:
  • creators – Author display names (e.g. ["John Smith", "Jane Doe"]).

  • published – Publication date string containing a 4-digit year.

  • title – Paper title.

Returns:

Citation key string (e.g. "costanzoGlobalGeneticInteraction2016").