generate_author_index¶
src.generators.authors.generate_author_index
¶
Generate and maintain the canonical author index.
The author index is the single source of truth for author identity and affiliation. Every author gets a stable integer ID that never changes.
Reads
- assets/data/authors.json (from generate_author_stats — names + display_names)
- assets/data/author_index.json (previous index, if any — preserves IDs)
Writes
- assets/data/author_index.json
Usage
python -m src.generators.generate_author_index --data_dir ../reprodb.github.io/src
load_existing_index(path: Path) -> tuple[list, dict[str, dict], int]
¶
Load the previous author index, return (list, name->entry dict, max_id).
Source code in src/generators/authors/generate_author_index.py
30 31 32 33 34 35 36 37 | |
load_authors_json(path: Path) -> list[dict]
¶
Load authors.json produced by generate_author_stats.
Source code in src/generators/authors/generate_author_index.py
40 41 42 43 44 | |
build_index(authors: list[dict], existing_by_name: dict[str, dict], max_id: int) -> list[dict]
¶
Build a new index, preserving existing IDs and syncing affiliations.
Returns the updated index list.
Source code in src/generators/authors/generate_author_index.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
generate_author_index(data_dir: str) -> dict
¶
Main entry point: build/update the canonical author index.
Source code in src/generators/authors/generate_author_index.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |