# asna-sudo/catalogue_raisonne_scraper architecture

> Architecture diagram of the GitHub repository asna-sudo/catalogue_raisonne_scraper, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/asna-sudo/catalogue_raisonne_scraper
- Repository: https://github.com/asna-sudo/catalogue_raisonne_scraper

## Overview

This repository contains two runnable versions of an Internet Archive catalogue-raisonné scraper. The principal workflow reads artist configuration and prior links from a Google Sheet, searches Archive records, filters candidate books, downloads PDFs, and records results locally; version 4 adds a pre-crawl cleanup and quarantine step and an Excel export. The graph separates the two script versions and their domain stages. Some version 4 orchestration and download details fall in excerpt gaps, so those relationships are omitted or marked unverified rather than asserted as inspected.

Main entry points: [`search_v4.py`](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py) (V4 runner), [`search.py`](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py) (V1 runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["Configuration"]
  node_v1_main["V1 runner<br/>[search.py]"]
  node_v1_sheet["V1 sheet loader<br/>[search.py]"]
  node_v4_main["V4 runner<br/>[search_v4.py]"]
  node_v4_cleanup["Local cleanup<br/>[search_v4.py]"]
  node_v4_sheet["V4 exclusion loader<br/>[search_v4.py]"]
end

subgraph group_discovery["Discovery and filtering"]
  node_v1_scraper["V1 artist scraper<br/>[search.py]"]
  node_v1_filter["V1 content filter<br/>[search.py]"]
  node_v4_crawler["V4 catalogue crawler<br/>[search_v4.py]"]
  node_v4_filter["V4 art filter<br/>[search_v4.py]"]
end

subgraph group_persistence["Local records and files"]
  node_v1_download["V1 PDF download<br/>[search.py]"]
  node_v1_manifest[("V1 manifest ledger<br/>[search.py]")]
  node_v4_download["V4 PDF download<br/>[search_v4.py]"]
  node_v4_manifest[("V4 manifest ledger<br/>[search_v4.py]")]
  node_v4_export["Excel export<br/>[search_v4.py]"]
  node_local_files[("PDF directory")]
end

node_researcher(("Researcher"))
node_sheet[("Google Sheet")]
node_archive[("Internet Archive")]

node_researcher -->|"runs"| node_v1_main
node_v1_main -->|"loads config"| node_v1_sheet
node_v1_sheet -->|"fetches CSV"| node_sheet
node_v1_main -->|"per artist"| node_v1_scraper
node_v1_scraper -->|"searches and reads"| node_archive
node_v1_scraper -->|"filters metadata"| node_v1_filter
node_v1_scraper -->|"downloads PDFs"| node_v1_download
node_v1_download -->|"retrieves files"| node_archive
node_v1_download -->|"flattens PDFs"| node_local_files
node_v1_main -->|"loads and saves"| node_v1_manifest
node_v1_manifest -->|"tracks assets"| node_local_files
node_researcher -->|"runs"| node_v4_main
node_v4_main -->|"runs first"| node_v4_cleanup
node_v4_cleanup -->|"scans and deletes"| node_local_files
node_v4_main -->|"loads exclusions"| node_v4_sheet
node_v4_sheet -->|"fetches CSV"| node_sheet
node_v4_main -->|"loads and saves"| node_v4_manifest
node_v4_main -.->|"starts crawl"| node_v4_crawler
node_v4_crawler -->|"reads item metadata"| node_archive
node_v4_crawler -->|"filters candidates"| node_v4_filter
node_v4_crawler -->|"downloads PDFs"| node_v4_download
node_v4_download -->|"stores flat PDFs"| node_local_files
node_v4_main -->|"exports records"| node_v4_export

click node_v1_main "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v1_sheet "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v1_scraper "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v1_filter "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v1_download "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v1_manifest "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py"
click node_v4_main "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_cleanup "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_sheet "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_crawler "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_filter "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_download "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_manifest "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"
click node_v4_export "https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_v1_main,node_v1_sheet,node_v4_main,node_v4_cleanup,node_v4_sheet toneBlue
class node_v1_scraper,node_v1_filter,node_v4_crawler,node_v4_filter,node_sheet,node_archive toneAmber
class node_v1_download,node_v1_manifest,node_v4_download,node_v4_manifest,node_v4_export,node_local_files toneMint
class node_researcher toneIndigo
```

## Components

### Configuration

- [V1 runner](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V1 sheet loader](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V4 runner](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- [Local cleanup](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- [V4 exclusion loader](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`

### Discovery and filtering

- [V1 artist scraper](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V1 content filter](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V4 catalogue crawler](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- [V4 art filter](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`

### Local records and files

- [V1 PDF download](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V1 manifest ledger](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search.py): `search.py`
- [V4 PDF download](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- [V4 manifest ledger](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- [Excel export](https://github.com/asna-sudo/catalogue_raisonne_scraper/blob/main/search_v4.py): `search_v4.py`
- **PDF directory**

### Other components

- **Researcher**
- **Google Sheet**
- **Internet Archive**

## Connections

- Researcher → V1 runner: runs (evidence: `search.py`)
- V1 runner → V1 sheet loader: loads config (evidence: `search.py`)
- V1 sheet loader → Google Sheet: fetches CSV (evidence: `search.py`)
- V1 runner → V1 artist scraper: per artist (evidence: `search.py`)
- V1 artist scraper → Internet Archive: searches and reads (evidence: `search.py`)
- V1 artist scraper → V1 content filter: filters metadata (evidence: `search.py`)
- V1 artist scraper → V1 PDF download: downloads PDFs (evidence: `search.py`)
- V1 PDF download → Internet Archive: retrieves files (evidence: `search.py`)
- V1 PDF download → PDF directory: flattens PDFs (evidence: `search.py`)
- V1 runner → V1 manifest ledger: loads and saves (evidence: `search.py`)
- V1 manifest ledger → PDF directory: tracks assets (evidence: `search.py`)
- Researcher → V4 runner: runs (evidence: `search_v4.py`)
- V4 runner → Local cleanup: runs first (evidence: `search_v4.py`)
- Local cleanup → PDF directory: scans and deletes (evidence: `search_v4.py`)
- V4 runner → V4 exclusion loader: loads exclusions (evidence: `search_v4.py`)
- V4 exclusion loader → Google Sheet: fetches CSV (evidence: `search_v4.py`)
- V4 runner → V4 manifest ledger: loads and saves (evidence: `search_v4.py`)
- V4 runner → V4 catalogue crawler: starts crawl (evidence: `search_v4.py`)
- V4 catalogue crawler → Internet Archive: reads item metadata (evidence: `search_v4.py`)
- V4 catalogue crawler → V4 art filter: filters candidates (evidence: `search_v4.py`)
- V4 catalogue crawler → V4 PDF download: downloads PDFs (evidence: `search_v4.py`)
- V4 PDF download → PDF directory: stores flat PDFs (evidence: `search_v4.py`)
- V4 runner → Excel export: exports records (evidence: `search_v4.py`)
