views-datafactory 1.9.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datafactory_adapters/ARCHITECTURE.md +54 -0
- datafactory_adapters/__init__.py +38 -0
- datafactory_adapters/_conservation.py +95 -0
- datafactory_adapters/_reconciliation.py +92 -0
- datafactory_adapters/_validation.py +39 -0
- datafactory_adapters/feature_frame.py +25 -0
- datafactory_adapters/grid_from_feature_frame.py +89 -0
- datafactory_adapters/grid_to_country_month.py +169 -0
- datafactory_adapters/grid_to_dataframe.py +176 -0
- datafactory_compilation/ARCHITECTURE.md +63 -0
- datafactory_compilation/__init__.py +39 -0
- datafactory_compilation/aggregation.py +64 -0
- datafactory_compilation/compilation_config.py +97 -0
- datafactory_compilation/conservation.py +36 -0
- datafactory_compilation/grid_compilation.py +352 -0
- datafactory_compilation/output.py +85 -0
- datafactory_compilation/preflight.py +61 -0
- datafactory_compilation/pregridded_compilation.py +291 -0
- datafactory_consolidation/ARCHITECTURE.md +58 -0
- datafactory_consolidation/__init__.py +28 -0
- datafactory_consolidation/consolidation_result.py +27 -0
- datafactory_consolidation/consolidators/__init__.py +32 -0
- datafactory_consolidation/consolidators/acled.py +462 -0
- datafactory_consolidation/consolidators/ucdp.py +524 -0
- datafactory_consolidation/event_store.py +67 -0
- datafactory_consolidation/tagging.py +46 -0
- datafactory_harvester/ARCHITECTURE.md +103 -0
- datafactory_harvester/__init__.py +37 -0
- datafactory_harvester/event_validation.py +372 -0
- datafactory_harvester/harvest_runner.py +72 -0
- datafactory_harvester/pipeline_runner.py +125 -0
- datafactory_harvester/snapshot_storage.py +117 -0
- datafactory_harvester/sources/__init__.py +36 -0
- datafactory_harvester/sources/_ucdp_common.py +34 -0
- datafactory_harvester/sources/acled.py +743 -0
- datafactory_harvester/sources/gaul_admin.py +567 -0
- datafactory_harvester/sources/ghsbuilts.py +271 -0
- datafactory_harvester/sources/ghspop.py +267 -0
- datafactory_harvester/sources/priogrid_static.py +359 -0
- datafactory_harvester/sources/shdi.py +625 -0
- datafactory_harvester/sources/ucdp_annual.py +616 -0
- datafactory_harvester/sources/ucdp_candidate.py +419 -0
- datafactory_harvester/sources/ucdp_dot9.py +407 -0
- datafactory_harvester/sources/vdem.py +350 -0
- datafactory_harvester/validation.py +74 -0
- datafactory_http/__init__.py +10 -0
- datafactory_http/retry.py +102 -0
- datafactory_priogrid/ARCHITECTURE.md +62 -0
- datafactory_priogrid/__init__.py +51 -0
- datafactory_priogrid/cell_generator.py +137 -0
- datafactory_priogrid/grid_config.py +107 -0
- datafactory_priogrid/land_mask.py +62 -0
- datafactory_priogrid/parity_validation.py +176 -0
- datafactory_priogrid/shapefile_harvester.py +174 -0
- datafactory_priogrid/shapefile_reader.py +125 -0
- datafactory_priogrid/spatiotemporal.py +66 -0
- datafactory_priogrid/temporal_config.py +78 -0
- datafactory_priogrid/temporal_generator.py +65 -0
- datafactory_provenance/ARCHITECTURE.md +61 -0
- datafactory_provenance/__init__.py +81 -0
- datafactory_provenance/constants.py +3 -0
- datafactory_provenance/digests_and_ledgers.py +370 -0
- datafactory_provenance/health.py +310 -0
- datafactory_provenance/pipeline_lock.py +200 -0
- datafactory_provenance/registry.py +92 -0
- datafactory_provenance/skip.py +212 -0
- datafactory_provenance/source_registry.py +466 -0
- datafactory_query/ARCHITECTURE.md +60 -0
- datafactory_query/__init__.py +36 -0
- datafactory_query/africa_me_gaul_pgids.json +1 -0
- datafactory_query/africa_me_legacy_pgids.json +1 -0
- datafactory_query/backends_npy.py +90 -0
- datafactory_query/backends_zarr.py +259 -0
- datafactory_query/coverage.py +64 -0
- datafactory_query/dataset.py +263 -0
- datafactory_query/defaults.py +101 -0
- datafactory_query/land_gaul_pgids.json +1 -0
- datafactory_query/land_pgids.json +1 -0
- datafactory_query/output_format.py +52 -0
- datafactory_query/regions.py +293 -0
- datafactory_query/temporal.py +115 -0
- datafactory_viewpoint/ARCHITECTURE.md +68 -0
- datafactory_viewpoint/__init__.py +33 -0
- datafactory_viewpoint/builders/__init__.py +32 -0
- datafactory_viewpoint/builders/acled_v1.py +213 -0
- datafactory_viewpoint/builders/ghsbuilts_v1.py +351 -0
- datafactory_viewpoint/builders/ghspop_v1.py +471 -0
- datafactory_viewpoint/builders/shdi_v1.py +389 -0
- datafactory_viewpoint/builders/ucdp_v1.py +437 -0
- datafactory_viewpoint/builders/vdem_v1.py +419 -0
- datafactory_viewpoint/profiles.py +169 -0
- datafactory_viewpoint/raster_io.py +49 -0
- datafactory_viewpoint/spatial_distribution.py +203 -0
- datafactory_viewpoint/spatial_weights.py +207 -0
- datafactory_viewpoint/survivorship.py +108 -0
- datafactory_viewpoint/temporal.py +111 -0
- datafactory_viewpoint/temporal_distribution.py +295 -0
- datafactory_viewpoint/viewpoint_config.py +124 -0
- datafactory_viewpoint/viewpoint_result.py +33 -0
- views_datafactory-1.9.0.dist-info/METADATA +528 -0
- views_datafactory-1.9.0.dist-info/RECORD +103 -0
- views_datafactory-1.9.0.dist-info/WHEEL +4 -0
- views_datafactory-1.9.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"""UCDP/GED .9 consolidated monthly dataset source.
|
|
2
|
+
|
|
3
|
+
Fetches the .9 version of UCDP conflict event data — a bespoke
|
|
4
|
+
monthly release produced by UCDP that contains exclusive events
|
|
5
|
+
not available in standard annual or candidate releases.
|
|
6
|
+
|
|
7
|
+
See reports/dot9_investigation/ for empirical findings.
|
|
8
|
+
|
|
9
|
+
Key differences from candidate:
|
|
10
|
+
- Version format: YY.9.MM (e.g., "25.9.11") instead of YY.0.MM
|
|
11
|
+
- Contains exclusive events not in standard releases (count varies by version and year)
|
|
12
|
+
- Undocumented by UCDP — no codebook or specification exists
|
|
13
|
+
- Production VIEWS forecasting depends on this data stream
|
|
14
|
+
"""
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
|
|
18
|
+
import logging
|
|
19
|
+
import time
|
|
20
|
+
from dataclasses import dataclass
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
|
|
23
|
+
import requests
|
|
24
|
+
|
|
25
|
+
from datafactory_harvester.event_validation import (
|
|
26
|
+
compare_snapshots,
|
|
27
|
+
date_range,
|
|
28
|
+
validate_events,
|
|
29
|
+
)
|
|
30
|
+
from datafactory_harvester.snapshot_storage import (
|
|
31
|
+
archive_snapshot,
|
|
32
|
+
save_event_snapshot,
|
|
33
|
+
)
|
|
34
|
+
from datafactory_harvester.sources import register_source
|
|
35
|
+
from datafactory_harvester.sources._ucdp_common import (
|
|
36
|
+
UCDP_GED_API_BASE,
|
|
37
|
+
validate_envelope,
|
|
38
|
+
)
|
|
39
|
+
from datafactory_harvester.sources.ucdp_annual import (
|
|
40
|
+
FIELD_TYPES,
|
|
41
|
+
REQUIRED_FIELDS,
|
|
42
|
+
UcdpAnnualConfig,
|
|
43
|
+
fetch_paginated,
|
|
44
|
+
get_ucdp_token,
|
|
45
|
+
)
|
|
46
|
+
from datafactory_harvester.validation import (
|
|
47
|
+
validate_month,
|
|
48
|
+
validate_positive_float,
|
|
49
|
+
validate_positive_int,
|
|
50
|
+
)
|
|
51
|
+
from datafactory_http import request_with_retry
|
|
52
|
+
from datafactory_provenance import (
|
|
53
|
+
DIGEST_SCHEME,
|
|
54
|
+
LEDGER_VERSION,
|
|
55
|
+
append_ledger_entry,
|
|
56
|
+
last_digest_for_version,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
logger = logging.getLogger(__name__)
|
|
60
|
+
|
|
61
|
+
DATASET_ID = "ucdp_dot9"
|
|
62
|
+
_DOT9_YEAR_OFFSET: int = 2000
|
|
63
|
+
_DISCOVERY_RATE_LIMIT_SECONDS: float = 0.5
|
|
64
|
+
_DISCOVERY_PROBE_PAGE_SIZE: int = 1
|
|
65
|
+
|
|
66
|
+
# .9 data availability (empirically confirmed 2026-03-21)
|
|
67
|
+
DOT9_FIRST_YEAR: int = 2018
|
|
68
|
+
DOT9_FIRST_MONTH: int = 1
|
|
69
|
+
_DEFAULT_MAX_VERSIONS: int = 120
|
|
70
|
+
_FETCH_DATE_RANGE_START: int = 2000
|
|
71
|
+
_FETCH_DATE_RANGE_END: int = 2099
|
|
72
|
+
_FETCH_DURATION_PRECISION: int = 1
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def _dot9_version_string(year: int, month: int) -> str:
|
|
76
|
+
"""Build a .9 monthly version string.
|
|
77
|
+
|
|
78
|
+
Format: "{year-2000}.9.{month}" — e.g., 2025/1 → "25.9.1".
|
|
79
|
+
"""
|
|
80
|
+
return f"{year - _DOT9_YEAR_OFFSET}.9.{month}"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
# ---- Config ----
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
@dataclass(frozen=True)
|
|
87
|
+
class UcdpDot9Config:
|
|
88
|
+
"""Configuration for fetching UCDP/GED .9 consolidated data.
|
|
89
|
+
|
|
90
|
+
Same structure as UcdpCandidateConfig but for the .9 stream.
|
|
91
|
+
Versions are discovered automatically from start_year/month.
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
# Discovery start
|
|
95
|
+
start_year: int = DOT9_FIRST_YEAR
|
|
96
|
+
start_month: int = DOT9_FIRST_MONTH
|
|
97
|
+
|
|
98
|
+
# API transport
|
|
99
|
+
base_url: str = UCDP_GED_API_BASE
|
|
100
|
+
page_size: int = 1000
|
|
101
|
+
timeout: int = 30 # paginated JSON ~100 KB/page (ADR-018)
|
|
102
|
+
max_retries: int = 3
|
|
103
|
+
|
|
104
|
+
# Discovery tuning
|
|
105
|
+
discovery_rate_limit: float = _DISCOVERY_RATE_LIMIT_SECONDS
|
|
106
|
+
max_versions: int = _DEFAULT_MAX_VERSIONS
|
|
107
|
+
|
|
108
|
+
# Storage
|
|
109
|
+
data_dir: Path = Path("data/raw/ucdp_dot9")
|
|
110
|
+
ledger_path: Path = Path(
|
|
111
|
+
"provenance/ucdp_dot9/ingestion_ledger.jsonl"
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
def __post_init__(self) -> None:
|
|
115
|
+
validate_month(self.start_month, "start_month")
|
|
116
|
+
validate_positive_int(self.start_year, "start_year")
|
|
117
|
+
validate_positive_int(self.page_size, "page_size")
|
|
118
|
+
validate_positive_int(self.max_retries, "max_retries")
|
|
119
|
+
validate_positive_float(
|
|
120
|
+
self.discovery_rate_limit, "discovery_rate_limit",
|
|
121
|
+
)
|
|
122
|
+
validate_positive_int(self.timeout, "timeout")
|
|
123
|
+
validate_positive_int(self.max_versions, "max_versions")
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
# ---- Version Discovery ----
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def discover_dot9_versions(
|
|
130
|
+
config: UcdpDot9Config,
|
|
131
|
+
*,
|
|
132
|
+
token: str | None = None,
|
|
133
|
+
) -> list[str]:
|
|
134
|
+
"""Discover available .9 monthly versions by probing the API.
|
|
135
|
+
|
|
136
|
+
Starts from config.start_year/start_month and probes forward
|
|
137
|
+
month by month until a version returns no data.
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
config: .9 configuration.
|
|
141
|
+
token: API token (falls back to UCDP_API_TOKEN env var).
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
Sorted list of available version strings.
|
|
145
|
+
"""
|
|
146
|
+
api_token = get_ucdp_token(token)
|
|
147
|
+
versions: list[str] = []
|
|
148
|
+
|
|
149
|
+
year = config.start_year
|
|
150
|
+
month = config.start_month
|
|
151
|
+
|
|
152
|
+
for _ in range(config.max_versions):
|
|
153
|
+
version = _dot9_version_string(year, month)
|
|
154
|
+
url = f"{config.base_url}/{version}"
|
|
155
|
+
headers = {"x-ucdp-access-token": api_token}
|
|
156
|
+
params = {"pagesize": _DISCOVERY_PROBE_PAGE_SIZE}
|
|
157
|
+
|
|
158
|
+
try:
|
|
159
|
+
resp = request_with_retry(
|
|
160
|
+
url,
|
|
161
|
+
headers=headers,
|
|
162
|
+
params=params,
|
|
163
|
+
max_retries=config.max_retries,
|
|
164
|
+
timeout=config.timeout,
|
|
165
|
+
)
|
|
166
|
+
except requests.RequestException:
|
|
167
|
+
logger.debug(
|
|
168
|
+
"Version %s not available — stopping",
|
|
169
|
+
version,
|
|
170
|
+
)
|
|
171
|
+
break
|
|
172
|
+
|
|
173
|
+
data = resp.json()
|
|
174
|
+
validate_envelope(data)
|
|
175
|
+
total = data["TotalCount"]
|
|
176
|
+
if total == 0:
|
|
177
|
+
logger.info(
|
|
178
|
+
"Version %s has 0 events — stopping",
|
|
179
|
+
version,
|
|
180
|
+
)
|
|
181
|
+
break
|
|
182
|
+
versions.append(version)
|
|
183
|
+
logger.info(
|
|
184
|
+
"Discovered .9 version %s (%d events)",
|
|
185
|
+
version, total,
|
|
186
|
+
)
|
|
187
|
+
time.sleep(config.discovery_rate_limit)
|
|
188
|
+
|
|
189
|
+
month += 1
|
|
190
|
+
if month > 12:
|
|
191
|
+
month = 1
|
|
192
|
+
year += 1
|
|
193
|
+
|
|
194
|
+
return versions
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
# ---- Fetch ----
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
def _snapshot_path(
|
|
201
|
+
config: UcdpDot9Config, version: str
|
|
202
|
+
) -> Path:
|
|
203
|
+
"""Build the Parquet snapshot path for a .9 version."""
|
|
204
|
+
return config.data_dir / f"ucdp_ged_dot9_{version}.parquet"
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
def _fetch_dot9_version(
|
|
208
|
+
config: UcdpDot9Config,
|
|
209
|
+
version: str,
|
|
210
|
+
*,
|
|
211
|
+
token: str | None = None,
|
|
212
|
+
force_refresh: bool = False,
|
|
213
|
+
) -> dict:
|
|
214
|
+
"""Fetch a single .9 monthly version.
|
|
215
|
+
|
|
216
|
+
Local-first: if the snapshot file exists and the ledger has a
|
|
217
|
+
matching digest, skip without touching the API. This makes
|
|
218
|
+
re-runs near-instant for already-fetched versions.
|
|
219
|
+
|
|
220
|
+
Returns a result dict with version, outcome, digest, and path.
|
|
221
|
+
"""
|
|
222
|
+
snap_path = _snapshot_path(config, version)
|
|
223
|
+
|
|
224
|
+
# Local-first skip: file exists + ledger has digest → skip API
|
|
225
|
+
if not force_refresh and snap_path.exists():
|
|
226
|
+
previous = last_digest_for_version(
|
|
227
|
+
config.ledger_path, version
|
|
228
|
+
)
|
|
229
|
+
if previous is not None:
|
|
230
|
+
logger.info(
|
|
231
|
+
"Version %s already on disk (digest: %s)",
|
|
232
|
+
version, previous,
|
|
233
|
+
)
|
|
234
|
+
return {
|
|
235
|
+
"version": version,
|
|
236
|
+
"outcome": "cached",
|
|
237
|
+
"digest": previous,
|
|
238
|
+
"path": str(snap_path),
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
annual_config = UcdpAnnualConfig(
|
|
242
|
+
version=version,
|
|
243
|
+
start_year=_FETCH_DATE_RANGE_START,
|
|
244
|
+
end_year=_FETCH_DATE_RANGE_END,
|
|
245
|
+
base_url=config.base_url,
|
|
246
|
+
page_size=config.page_size,
|
|
247
|
+
timeout=config.timeout,
|
|
248
|
+
max_retries=config.max_retries,
|
|
249
|
+
data_dir=config.data_dir,
|
|
250
|
+
ledger_path=config.ledger_path,
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
# Fetch from API
|
|
254
|
+
t0 = time.monotonic()
|
|
255
|
+
events = fetch_paginated(annual_config, token=token)
|
|
256
|
+
fetch_duration = time.monotonic() - t0
|
|
257
|
+
|
|
258
|
+
# Empty result = version no longer served by UCDP
|
|
259
|
+
if not events:
|
|
260
|
+
logger.debug(
|
|
261
|
+
"Version %s: 0 events (no longer served)", version,
|
|
262
|
+
)
|
|
263
|
+
return {
|
|
264
|
+
"version": version,
|
|
265
|
+
"outcome": "not_served",
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
# Validate
|
|
269
|
+
validation = validate_events(
|
|
270
|
+
events, REQUIRED_FIELDS, FIELD_TYPES
|
|
271
|
+
)
|
|
272
|
+
|
|
273
|
+
# Compute actual date coverage
|
|
274
|
+
min_date, max_date = date_range(events)
|
|
275
|
+
|
|
276
|
+
base_entry = {
|
|
277
|
+
"dataset": DATASET_ID,
|
|
278
|
+
"version": version,
|
|
279
|
+
"n_events": validation.n_events,
|
|
280
|
+
"min_date_start": min_date,
|
|
281
|
+
"max_date_start": max_date,
|
|
282
|
+
"fetch_duration_s": round(
|
|
283
|
+
fetch_duration, _FETCH_DURATION_PRECISION
|
|
284
|
+
),
|
|
285
|
+
"content_digest": validation.content_digest,
|
|
286
|
+
"ledger_version": LEDGER_VERSION,
|
|
287
|
+
"digest_algorithm": DIGEST_SCHEME,
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if not validation.valid:
|
|
291
|
+
err_msg = (
|
|
292
|
+
f"Validation failed for {version}: "
|
|
293
|
+
f"{validation.errors}"
|
|
294
|
+
)
|
|
295
|
+
logger.error(err_msg)
|
|
296
|
+
append_ledger_entry(config.ledger_path, {
|
|
297
|
+
**base_entry,
|
|
298
|
+
"outcome": "failed",
|
|
299
|
+
"errors": validation.errors,
|
|
300
|
+
"warnings": validation.warnings,
|
|
301
|
+
})
|
|
302
|
+
return {
|
|
303
|
+
"version": version,
|
|
304
|
+
"outcome": "failed",
|
|
305
|
+
"errors": validation.errors,
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
# Digest-based caching
|
|
309
|
+
previous = last_digest_for_version(
|
|
310
|
+
config.ledger_path, version
|
|
311
|
+
)
|
|
312
|
+
changed = (
|
|
313
|
+
previous is None
|
|
314
|
+
or previous != validation.content_digest
|
|
315
|
+
)
|
|
316
|
+
|
|
317
|
+
if not changed and not force_refresh and snap_path.exists():
|
|
318
|
+
logger.info(
|
|
319
|
+
"Version %s unchanged (digest: %s)",
|
|
320
|
+
version, validation.content_digest,
|
|
321
|
+
)
|
|
322
|
+
append_ledger_entry(config.ledger_path, {
|
|
323
|
+
**base_entry,
|
|
324
|
+
"outcome": "unchanged",
|
|
325
|
+
})
|
|
326
|
+
return {
|
|
327
|
+
"version": version,
|
|
328
|
+
"outcome": "unchanged",
|
|
329
|
+
"digest": validation.content_digest,
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
# Compare + archive + store
|
|
333
|
+
comparison = None
|
|
334
|
+
if snap_path.exists():
|
|
335
|
+
comparison = compare_snapshots(snap_path, events)
|
|
336
|
+
if comparison.has_previous:
|
|
337
|
+
logger.info(
|
|
338
|
+
"Version %s: %d added, %d removed, %d revised",
|
|
339
|
+
version,
|
|
340
|
+
comparison.n_added,
|
|
341
|
+
comparison.n_removed,
|
|
342
|
+
comparison.n_revised,
|
|
343
|
+
)
|
|
344
|
+
archive_snapshot(snap_path)
|
|
345
|
+
|
|
346
|
+
save_event_snapshot(events, snap_path)
|
|
347
|
+
|
|
348
|
+
revision_warnings = (
|
|
349
|
+
comparison.warnings if comparison else []
|
|
350
|
+
)
|
|
351
|
+
append_ledger_entry(config.ledger_path, {
|
|
352
|
+
**base_entry,
|
|
353
|
+
"outcome": "success",
|
|
354
|
+
"schema_fields": sorted(
|
|
355
|
+
validation.schema_snapshot.keys()
|
|
356
|
+
),
|
|
357
|
+
"warnings": validation.warnings + revision_warnings,
|
|
358
|
+
"errors": validation.errors,
|
|
359
|
+
})
|
|
360
|
+
|
|
361
|
+
return {
|
|
362
|
+
"version": version,
|
|
363
|
+
"outcome": "success",
|
|
364
|
+
"digest": validation.content_digest,
|
|
365
|
+
"n_events": validation.n_events,
|
|
366
|
+
"path": str(snap_path),
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def fetch_ucdp_dot9(
|
|
371
|
+
config: UcdpDot9Config | None = None,
|
|
372
|
+
*,
|
|
373
|
+
token: str | None = None,
|
|
374
|
+
force_refresh: bool = False,
|
|
375
|
+
) -> list[dict]:
|
|
376
|
+
"""Fetch all available .9 monthly versions.
|
|
377
|
+
|
|
378
|
+
Discovers versions by probing the API forward from
|
|
379
|
+
config.start_year/start_month, then fetches each.
|
|
380
|
+
|
|
381
|
+
Args:
|
|
382
|
+
config: .9 configuration. Uses defaults if None.
|
|
383
|
+
token: API token (falls back to UCDP_API_TOKEN env var).
|
|
384
|
+
force_refresh: Re-fetch even if digest unchanged.
|
|
385
|
+
|
|
386
|
+
Returns:
|
|
387
|
+
List of result dicts, one per version fetched.
|
|
388
|
+
"""
|
|
389
|
+
if config is None:
|
|
390
|
+
config = UcdpDot9Config()
|
|
391
|
+
|
|
392
|
+
versions = discover_dot9_versions(config, token=token)
|
|
393
|
+
logger.info("Discovered %d .9 versions", len(versions))
|
|
394
|
+
|
|
395
|
+
results: list[dict] = []
|
|
396
|
+
for version in versions:
|
|
397
|
+
result = _fetch_dot9_version(
|
|
398
|
+
config, version,
|
|
399
|
+
token=token, force_refresh=force_refresh,
|
|
400
|
+
)
|
|
401
|
+
results.append(result)
|
|
402
|
+
|
|
403
|
+
return results
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
# Auto-register
|
|
407
|
+
register_source("ucdp_dot9", fetch_ucdp_dot9)
|