# jeffersonlab/jlab_archiver_client architecture

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

- Interactive diagram: https://gitdiagram.com/jeffersonlab/jlab_archiver_client
- Repository: https://github.com/jeffersonlab/jlab_archiver_client

## Overview

jlab_archiver_client is a Python analysis client for the Jefferson Lab EPICS archive, accessed through myquery. Users build validated endpoint-specific queries, execute them through the matching client, and receive pandas-oriented results; interval, mysampler, mystats, point, and channel cover distinct retrieval and discovery needs. The CLI exposes query workflows, while shared configuration and conversion utilities support them. The excerpts show representative request and parsing paths; some module interactions are supported only by the SOURCE INDEX or README, so unsampled details are not expanded.

Main entry points: [`src/jlab_archiver_client/__init__.py`](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/__init__.py) (Python package API), [`src/jlab_archiver_client/interval.py`](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/interval.py) (Interval queries), [`src/jlab_archiver_client/scripts.py`](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/scripts.py) (Command-line tools), [`src/jlab_archiver_client/mysampler.py`](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/mysampler.py) (Regular sampling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_query["Query and settings"]
  node_query_builders["Query builders<br/>[query.py]"]
  node_configuration["Runtime configuration<br/>[config.py]"]
end

subgraph group_retrieval["Archive retrieval"]
  node_interval["Interval queries<br/>[interval.py]"]
  node_mysampler["Regular sampling<br/>[mysampler.py]"]
  node_mystats["Binned statistics<br/>[mystats.py]"]
  node_point["Point lookup<br/>[point.py]"]
  node_channel["Channel search<br/>[channel.py]"]
end

subgraph group_processing["Result processing"]
  node_conversions["Data conversion<br/>[utils.py]"]
  node_query_errors["Query errors<br/>[exceptions.py]"]
end

subgraph group_interface["User interfaces"]
  node_cli["Command-line tools<br/>[scripts.py]"]
  node_package_api["Python package API<br/>[__init__.py]"]
end

node_analyst(("Analyst"))
node_myquery{{"myquery service"}}

node_analyst -->|"uses"| node_package_api
node_analyst -->|"runs"| node_cli
node_package_api -->|"exports"| node_query_builders
node_package_api -->|"exports"| node_interval
node_package_api -->|"exports"| node_mysampler
node_package_api -->|"exports"| node_mystats
node_package_api -->|"exports"| node_point
node_package_api -->|"exports"| node_channel
node_interval -->|"serializes parameters"| node_query_builders
node_mysampler -->|"serializes parameters"| node_query_builders
node_mystats -->|"serializes parameters"| node_query_builders
node_point -->|"serializes parameters"| node_query_builders
node_channel -->|"serializes parameters"| node_query_builders
node_interval -->|"configures endpoint"| node_configuration
node_mysampler -->|"configures endpoint"| node_configuration
node_mystats -->|"configures endpoint"| node_configuration
node_point -->|"configures endpoint"| node_configuration
node_channel -->|"configures endpoint"| node_configuration
node_interval -->|"requests events"| node_myquery
node_mysampler -->|"requests samples"| node_myquery
node_mystats -->|"requests statistics"| node_myquery
node_point -->|"requests event"| node_myquery
node_channel -->|"searches channels"| node_myquery
node_interval -->|"converts response"| node_conversions
node_mysampler -->|"converts response"| node_conversions
node_mystats -->|"converts response"| node_conversions
node_point -->|"checks response"| node_conversions
node_channel -->|"checks response"| node_conversions
node_interval -->|"raises errors"| node_query_errors
node_cli -->|"runs query"| node_interval
node_cli -->|"runs query"| node_mysampler
node_cli -->|"runs query"| node_mystats
node_cli -->|"runs query"| node_point
node_cli -->|"runs query"| node_channel

click node_query_builders "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/query.py"
click node_configuration "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/config.py"
click node_interval "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/interval.py"
click node_mysampler "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/mysampler.py"
click node_mystats "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/mystats.py"
click node_point "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/point.py"
click node_channel "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/channel.py"
click node_conversions "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/utils.py"
click node_query_errors "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/exceptions.py"
click node_cli "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/scripts.py"
click node_package_api "https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/__init__.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_query_builders,node_configuration toneBlue
class node_interval,node_mysampler,node_mystats,node_point,node_channel toneAmber
class node_conversions,node_query_errors toneMint
class node_cli,node_package_api toneRose
class node_analyst,node_myquery toneIndigo
```

## Components

### Query and settings

- [Query builders](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/query.py): `src/jlab_archiver_client/query.py`
- [Runtime configuration](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/config.py): `src/jlab_archiver_client/config.py`

### Archive retrieval

- [Interval queries](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/interval.py): `src/jlab_archiver_client/interval.py`
- [Regular sampling](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/mysampler.py): `src/jlab_archiver_client/mysampler.py`
- [Binned statistics](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/mystats.py): `src/jlab_archiver_client/mystats.py`
- [Point lookup](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/point.py): `src/jlab_archiver_client/point.py`
- [Channel search](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/channel.py): `src/jlab_archiver_client/channel.py`

### Result processing

- [Data conversion](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/utils.py): `src/jlab_archiver_client/utils.py`
- [Query errors](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/exceptions.py): `src/jlab_archiver_client/exceptions.py`

### User interfaces

- [Command-line tools](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/scripts.py): `src/jlab_archiver_client/scripts.py`
- [Python package API](https://github.com/jeffersonlab/jlab_archiver_client/blob/main/src/jlab_archiver_client/__init__.py): `src/jlab_archiver_client/__init__.py`

### Other components

- **Analyst**
- **myquery service**

## Connections

- Analyst → Python package API: uses (evidence: `README.md`)
- Analyst → Command-line tools: runs (evidence: `src/jlab_archiver_client/scripts.py`)
- Python package API → Query builders: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Python package API → Interval queries: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Python package API → Regular sampling: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Python package API → Binned statistics: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Python package API → Point lookup: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Python package API → Channel search: exports (evidence: `src/jlab_archiver_client/__init__.py`)
- Interval queries → Query builders: serializes parameters (evidence: `src/jlab_archiver_client/interval.py`)
- Regular sampling → Query builders: serializes parameters (evidence: `src/jlab_archiver_client/mysampler.py`)
- Binned statistics → Query builders: serializes parameters (evidence: `src/jlab_archiver_client/query.py`)
- Point lookup → Query builders: serializes parameters (evidence: `src/jlab_archiver_client/point.py`)
- Channel search → Query builders: serializes parameters (evidence: `src/jlab_archiver_client/channel.py`)
- Interval queries → Runtime configuration: configures endpoint (evidence: `src/jlab_archiver_client/interval.py`)
- Regular sampling → Runtime configuration: configures endpoint (evidence: `src/jlab_archiver_client/mysampler.py`)
- Binned statistics → Runtime configuration: configures endpoint (evidence: `src/jlab_archiver_client/mystats.py`)
- Point lookup → Runtime configuration: configures endpoint (evidence: `src/jlab_archiver_client/point.py`)
- Channel search → Runtime configuration: configures endpoint (evidence: `src/jlab_archiver_client/channel.py`)
- Interval queries → myquery service: requests events (evidence: `src/jlab_archiver_client/interval.py`)
- Regular sampling → myquery service: requests samples (evidence: `src/jlab_archiver_client/mysampler.py`)
- Binned statistics → myquery service: requests statistics (evidence: `src/jlab_archiver_client/mystats.py`)
- Point lookup → myquery service: requests event (evidence: `src/jlab_archiver_client/point.py`)
- Channel search → myquery service: searches channels (evidence: `src/jlab_archiver_client/channel.py`)
- Interval queries → Data conversion: converts response (evidence: `src/jlab_archiver_client/interval.py`)
- Regular sampling → Data conversion: converts response (evidence: `src/jlab_archiver_client/mysampler.py`)
- Binned statistics → Data conversion: converts response (evidence: `src/jlab_archiver_client/mystats.py`)
- Point lookup → Data conversion: checks response (evidence: `src/jlab_archiver_client/point.py`)
- Channel search → Data conversion: checks response (evidence: `src/jlab_archiver_client/channel.py`)
- Interval queries → Query errors: raises errors (evidence: `src/jlab_archiver_client/exceptions.py`)
- Command-line tools → Interval queries: runs query (evidence: `src/jlab_archiver_client/scripts.py`)
- Command-line tools → Regular sampling: runs query (evidence: `src/jlab_archiver_client/scripts.py`)
- Command-line tools → Binned statistics: runs query (evidence: `src/jlab_archiver_client/scripts.py`)
- Command-line tools → Point lookup: runs query (evidence: `src/jlab_archiver_client/scripts.py`)
- Command-line tools → Channel search: runs query (evidence: `src/jlab_archiver_client/scripts.py`)
