# esgf/esg-publisher architecture

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

- Interactive diagram: https://gitdiagram.com/esgf/esg-publisher
- Repository: https://github.com/esgf/esg-publisher

## Overview

ESGF Publisher scans and describes scientific datasets, applies project-specific metadata rules, then publishes or updates records across ESGF indexing and catalog services. The current Python package contains the scanning and publication framework, project handlers, and Solr, STAC, and Globus integrations; the tree also retains a separate legacy publisher and GUI. The principal workflow is represented through the generic publisher, with meaningful backend and utility branches. Some relationships are based on SOURCE INDEX references rather than complete excerpts, so uncertain orchestration links are omitted.

Main entry points: [`src/python/esgcet/project/generic_pub.py`](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_pub.py) (Generic publisher), [`src/python/esgcet/project/generic_netcdf.py`](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_netcdf.py) (NetCDF publisher), [`src/python/esgcet/cli/publisher.py`](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/cli/publisher.py) (Publisher CLI), [`src/python/esgcet/solr/index_pub.py`](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/solr/index_pub.py) (Solr publication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Publisher entry"]
  node_cli["Publisher CLI<br/>[publisher.py]"]
  node_publisher["Generic publisher<br/>[generic_pub.py]"]
end

subgraph group_dataset["Dataset preparation"]
  node_projects["Project handlers"]
  node_netcdf["NetCDF publisher<br/>[generic_netcdf.py]"]
  node_scanner["Dataset scanner<br/>[mk_dataset.py]"]
  node_scan_handlers["Format handlers"]
  node_kerchunk["Kerchunk generation"]
  node_map_model["Kerchunk map model<br/>[mapfile_model.py]"]
end

subgraph group_backends["Publication backends"]
  node_solr["Solr publication<br/>[index_pub.py]"]
  node_solr_client["Solr REST client<br/>[pub_client.py]"]
  node_stac_converter["STAC conversion<br/>[stac_converter.py]"]
  node_stac_client["STAC transaction client<br/>[stac_client.py]"]
  node_globus["Globus Search<br/>[update_globus.py]"]
end

subgraph group_support["Publisher support"]
  node_mapfile["Mapfile tools<br/>[mapfile.py]"]
  node_pid["PID and citation<br/>[pid_cite_pub.py]"]
  node_settings["Publisher settings<br/>[settings.py]"]
  node_logger["Logging<br/>[logger.py]"]
end

node_operator(("Operator"))
node_solr_service(("Solr service"))
node_stac_service(("STAC service"))
node_globus_service(("Globus Search service"))

node_operator -.->|"invokes"| node_cli
node_cli -.->|"runs"| node_publisher
node_publisher -->|"selects"| node_projects
node_publisher -->|"uses"| node_netcdf
node_netcdf -->|"scans datasets"| node_scanner
node_netcdf -->|"uses"| node_scan_handlers
node_netcdf -->|"uses"| node_map_model
node_netcdf -->|"generates references"| node_kerchunk
node_publisher -->|"reads"| node_mapfile
node_publisher -->|"publishes"| node_solr
node_publisher -->|"converts records"| node_stac_converter
node_publisher -->|"publishes records"| node_stac_client
node_publisher -->|"updates records"| node_globus
node_publisher -->|"publishes citations"| node_pid
node_solr -.->|"uses"| node_solr_client
node_solr_client -->|"posts records"| node_solr_service
node_stac_client -->|"sends transactions"| node_stac_service
node_globus -.->|"updates index"| node_globus_service
node_publisher -->|"reads"| node_settings
node_publisher -->|"uses"| node_logger

click node_cli "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/cli/publisher.py"
click node_publisher "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_pub.py"
click node_projects "https://github.com/esgf/esg-publisher/tree/main/src/python/esgcet/project"
click node_netcdf "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_netcdf.py"
click node_scanner "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/scan/mk_dataset.py"
click node_scan_handlers "https://github.com/esgf/esg-publisher/tree/main/src/python/esgcet/scan"
click node_mapfile "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/mapfile.py"
click node_kerchunk "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/kerchunk/kerchunk_generator.py"
click node_map_model "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/kerchunk/mapfile_model.py"
click node_solr "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/solr/index_pub.py"
click node_solr_client "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/solr/pub_client.py"
click node_stac_converter "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/stac/stac_converter.py"
click node_stac_client "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/stac/stac_client.py"
click node_globus "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/globus/update_globus.py"
click node_pid "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/pid_cite_pub.py"
click node_settings "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/settings.py"
click node_logger "https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/logger.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_cli,node_publisher toneBlue
class node_projects,node_netcdf,node_scanner,node_scan_handlers,node_kerchunk,node_map_model toneAmber
class node_solr,node_solr_client,node_stac_converter,node_stac_client,node_globus toneMint
class node_mapfile,node_pid,node_settings,node_logger toneRose
class node_operator,node_solr_service,node_stac_service,node_globus_service toneIndigo
```

## Components

### Publisher entry

- [Publisher CLI](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/cli/publisher.py): `src/python/esgcet/cli/publisher.py`
- [Generic publisher](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_pub.py): `src/python/esgcet/project/generic_pub.py`

### Dataset preparation

- [Project handlers](https://github.com/esgf/esg-publisher/tree/main/src/python/esgcet/project): `src/python/esgcet/project`
- [NetCDF publisher](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/project/generic_netcdf.py): `src/python/esgcet/project/generic_netcdf.py`
- [Dataset scanner](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/scan/mk_dataset.py): `src/python/esgcet/scan/mk_dataset.py`
- [Format handlers](https://github.com/esgf/esg-publisher/tree/main/src/python/esgcet/scan): `src/python/esgcet/scan`
- [Kerchunk generation](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/kerchunk/kerchunk_generator.py): `src/python/esgcet/kerchunk/kerchunk_generator.py`
- [Kerchunk map model](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/kerchunk/mapfile_model.py): `src/python/esgcet/kerchunk/mapfile_model.py`

### Publication backends

- [Solr publication](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/solr/index_pub.py): `src/python/esgcet/solr/index_pub.py`
- [Solr REST client](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/solr/pub_client.py): `src/python/esgcet/solr/pub_client.py`
- [STAC conversion](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/stac/stac_converter.py): `src/python/esgcet/stac/stac_converter.py`
- [STAC transaction client](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/stac/stac_client.py): `src/python/esgcet/stac/stac_client.py`
- [Globus Search](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/globus/update_globus.py): `src/python/esgcet/globus/update_globus.py`

### Publisher support

- [Mapfile tools](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/mapfile.py): `src/python/esgcet/util/mapfile.py`
- [PID and citation](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/pid_cite_pub.py): `src/python/esgcet/util/pid_cite_pub.py`
- [Publisher settings](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/settings.py): `src/python/esgcet/util/settings.py`
- [Logging](https://github.com/esgf/esg-publisher/blob/main/src/python/esgcet/util/logger.py): `src/python/esgcet/util/logger.py`

### Other components

- **Operator**
- **Solr service**
- **STAC service**
- **Globus Search service**

## Connections

- Operator → Publisher CLI: invokes
- Publisher CLI → Generic publisher: runs
- Generic publisher → Project handlers: selects (evidence: `src/python/esgcet/__init__.py`)
- Generic publisher → NetCDF publisher: uses (evidence: `src/python/esgcet/project/generic_pub.py`)
- NetCDF publisher → Dataset scanner: scans datasets (evidence: `src/python/esgcet/project/generic_netcdf.py`)
- NetCDF publisher → Format handlers: uses (evidence: `src/python/esgcet/project/generic_netcdf.py`)
- NetCDF publisher → Kerchunk map model: uses (evidence: `src/python/esgcet/project/generic_netcdf.py`)
- NetCDF publisher → Kerchunk generation: generates references (evidence: `src/python/esgcet/project/generic_netcdf.py`)
- Generic publisher → Mapfile tools: reads (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → Solr publication: publishes (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → STAC conversion: converts records (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → STAC transaction client: publishes records (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → Globus Search: updates records (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → PID and citation: publishes citations (evidence: `src/python/esgcet/project/generic_pub.py`)
- Solr publication → Solr REST client: uses
- Solr REST client → Solr service: posts records (evidence: `src/python/esgcet/solr/pub_client.py`)
- STAC transaction client → STAC service: sends transactions (evidence: `src/python/esgcet/stac/stac_client.py`)
- Globus Search → Globus Search service: updates index
- Generic publisher → Publisher settings: reads (evidence: `src/python/esgcet/project/generic_pub.py`)
- Generic publisher → Logging: uses (evidence: `src/python/esgcet/project/generic_pub.py`)
