Skip to content

Scripts and Automation

Alexander Refsum Jensenius edited this page Jun 17, 2026 · 3 revisions

Scripts and Automation

Python scripts live in scripts/. Install dependencies:

python3 -m venv venv
source venv/bin/activate
pip install -r scripts/requirements.txt

Paths default to site/ (see scripts/repo_paths.py). Full details: scripts/README.md in the repo.

Directory and data sync

Script Purpose
enrich_directory_from_nva.py Refresh people from NVA/ORCID (affiliation, tags, bio, publications, portrait)
sync_results_from_nva.py Sync MishMash publications to site/_data/mishmash_results.yml
fill_missing_nva_orcid.py Add missing urls.nva / urls.orcid only
validate_directory.py Validate directory entries and bidirectional cross-links
generate_directory_governance.py Generate people/institutions from board, council, WP leaders
sync_directory_reciprocity.py Fix reciprocity in directory cross-links
import_directory_survey_csv.py Import survey CSV into directory entries
merge_tags.py Merge similar tags using config/tag_merge_map.yml

Nightly CI: .github/workflows/enrich-directory-people.yml runs NVA enrich + results sync and may push to main.

NVA credentials: config/README.md — never commit JSON credential files.

Event fetching

Script Purpose
fetch_uio_events.py Scrape UiO/Ritmo event pages → site/_events/
fetch_rss_to_events.py RSS feed → event Markdown
fetch_partner_ai_events.py Crawl partner sites → site/_data/partner_events.yml

Institution helpers

Script Purpose
sync_institution_wikipedia.py Wikipedia summaries for institutions
sync_institution_websites.py Institution website URLs
sync_institution_summaries.py Sync institution summary text
link_institution_logos.py / download_partner_logos.py Logo assets

Images and assets

Script Purpose
make_portraits_transparent.py Remove portrait backgrounds
convert_portraits_to_greyscale.py Greyscale portraits
compress_large_portraits.py Compress oversized portraits
combine_image_slices.py Combine two images side by side
make_qr_code.py QR codes for internal pages
generate_bubble_gifs.sh Animated bubble logo variants

Chat / knowledge base

Script Purpose
build_knowledge_base.py Build JSON knowledge base for the AI chat interface

Tests

python3 scripts/test_tag_merge.py
python3 scripts/test_directory_sync.py
python3 scripts/test_nva_api_auth.py   # requires NVA credentials

Config files

File Purpose
config/tag_merge_map.yml Canonical tag names and variants to merge
config/nva-credentials.prod.json NVA API credentials (gitignored)

Clone this wiki locally